]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rebase: avoid using the comma operator unnecessarily
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 27 Mar 2025 11:52:55 +0000 (11:52 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 29 Mar 2025 00:38:08 +0000 (17:38 -0700)
The comma operator is a somewhat obscure C feature that is often used by
mistake and can even cause unintentional code flow. Better use a
semicolon instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c

index d4715ed35d77edf9065dec9a46ed433a30d7fd68..62bdf7276f71a8c59a4537d66743929355ead9be 100644 (file)
@@ -1843,7 +1843,7 @@ int cmd_rebase(int argc,
        strbuf_addf(&msg, "%s (start): checkout %s",
                    options.reflog_action, options.onto_name);
        ropts.oid = &options.onto->object.oid;
-       ropts.orig_head = &options.orig_head->object.oid,
+       ropts.orig_head = &options.orig_head->object.oid;
        ropts.flags = RESET_HEAD_DETACH | RESET_ORIG_HEAD |
                        RESET_HEAD_RUN_POST_CHECKOUT_HOOK;
        ropts.head_msg = msg.buf;