]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'cb/builtin-merge-format-string-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 12 Oct 2021 20:51:23 +0000 (13:51 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Oct 2021 20:51:23 +0000 (13:51 -0700)
Code clean-up.

* cb/builtin-merge-format-string-fix:
  builtin/merge: avoid -Wformat-extra-args from ancient Xcode

builtin/merge.c

index a3282bf0e8503e7b565440181bfa7edfd434d801..097a74b13971b4ced61773809edda1bc1a92c207 100644 (file)
@@ -862,9 +862,11 @@ static void prepare_to_commit(struct commit_list *remoteheads)
                        strbuf_commented_addf(&msg, "\n");
                }
                strbuf_commented_addf(&msg, _(merge_editor_comment));
-               strbuf_commented_addf(&msg, _(cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS ?
-                       scissors_editor_comment :
-                       no_scissors_editor_comment), comment_line_char);
+               if (cleanup_mode == COMMIT_MSG_CLEANUP_SCISSORS)
+                       strbuf_commented_addf(&msg, _(scissors_editor_comment));
+               else
+                       strbuf_commented_addf(&msg,
+                               _(no_scissors_editor_comment), comment_line_char);
        }
        if (signoff)
                append_signoff(&msg, ignore_non_trailer(msg.buf, msg.len), 0);