]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/merge: avoid -Wformat-extra-args from ancient Xcode
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Sun, 8 Aug 2021 03:38:34 +0000 (20:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Aug 2021 16:48:01 +0000 (09:48 -0700)
d540b70c85 (merge: cleanup messages like commit, 2019-04-17) adds
a way to change part of the helper text using a single call to
strbuf_add_commented_addf but with two formats with varying number
of parameters.

this trigger a warning in old versions of Xcode (ex 8.0), so use
instead two independent calls with a matching number of parameters

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c

index e96f72af8044769df6b4ef42f0525b572b0c39e2..bb52f330977e23c0709278b5229c5acf7f0b57dd 100644 (file)
@@ -830,9 +830,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);