From: Jonathan Nieder Date: Tue, 17 Aug 2010 07:06:56 +0000 (-0500) Subject: merge script: handle -m --log correctly X-Git-Tag: v1.7.3-rc0~16^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=eeb70b6769ad484989c8708a85fef112726a35e1;p=git.git merge script: handle -m --log correctly Based on v1.7.1.1~23^2 (merge: --log appends shortlog to message if specified, 2010-05-11). Without this change, the scripted (non-builtin) merge does not pass t7604. Cc: Tay Ray Chuan Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh index bab3da9ee..91e33a3f0 100755 --- a/contrib/examples/git-merge.sh +++ b/contrib/examples/git-merge.sh @@ -294,12 +294,18 @@ else # the given message. If remote is invalid we will die # later in the common codepath so we discard the error # in this loop. - merge_name=$(for remote + merge_msg="$( + for remote do merge_name "$remote" - done | git fmt-merge-msg $log_arg - ) - merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name" + done | + if test "$have_message" = t + then + git fmt-merge-msg -m "$merge_msg" $log_arg + else + git fmt-merge-msg $log_arg + fi + )" fi head=$(git rev-parse --verify "$head_arg"^0) || usage