From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
To: git@vger.kernel.org
Subject: [PATCH v2] rebase: clarify conditionals in todo_list_to_strbuf()
Date: Fri, 28 Apr 2023 14:56:01 +0200 [thread overview]
Message-ID: <20230428125601.1719750-1-oswald.buddenhagen@gmx.de> (raw)
In-Reply-To: <20230323162235.995559-1-oswald.buddenhagen@gmx.de>
Make it obvious that the two conditional branches are mutually
exclusive. This makes it easier to comprehend and optimize.
As a drive-by, remove a pair of unnecessary braces.
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
---
v2:
- slightly more verbose commit message
---
sequencer.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 3be23d7ca2..9169876441 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -5868,12 +5868,9 @@ static void todo_list_to_strbuf(struct repository *r, struct todo_list *todo_lis
if (item->command == TODO_FIXUP) {
if (item->flags & TODO_EDIT_FIXUP_MSG)
strbuf_addstr(buf, " -c");
- else if (item->flags & TODO_REPLACE_FIXUP_MSG) {
+ else if (item->flags & TODO_REPLACE_FIXUP_MSG)
strbuf_addstr(buf, " -C");
- }
- }
-
- if (item->command == TODO_MERGE) {
+ } else if (item->command == TODO_MERGE) {
if (item->flags & TODO_EDIT_MERGE_MSG)
strbuf_addstr(buf, " -c");
else
--
2.40.0.152.g15d061e6df
next prev parent reply other threads:[~2023-04-28 12:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 16:22 [PATCH] rebase: clarify conditionals in todo_list_to_strbuf() Oswald Buddenhagen
2023-03-23 20:32 ` Taylor Blau
2023-03-24 8:59 ` Oswald Buddenhagen
2023-03-24 14:39 ` Phillip Wood
2023-04-28 12:56 ` Oswald Buddenhagen [this message]
2023-05-02 18:51 ` [PATCH v2] " Felipe Contreras
2023-08-07 17:09 ` [PATCH v3] " Oswald Buddenhagen
2023-08-07 20:28 ` Junio C Hamano
2023-08-09 16:13 ` Oswald Buddenhagen
2023-08-09 19:39 ` Junio C Hamano
2023-08-10 12:08 ` Oswald Buddenhagen
2023-08-10 16:03 ` Junio C Hamano
2023-08-11 10:33 ` Oswald Buddenhagen
2023-08-11 11:41 ` Richard Kerry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230428125601.1719750-1-oswald.buddenhagen@gmx.de \
--to=oswald.buddenhagen@gmx.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).