summaryrefslogtreecommitdiff
path: root/contrib/examples/git-merge.sh
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-08-17 07:06:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-08-18 21:02:05 (GMT)
commiteeb70b6769ad484989c8708a85fef112726a35e1 (patch)
treeef54dd4b5c0d57bc5683c07de2abba4a99fac816 /contrib/examples/git-merge.sh
parentf5d3a6f575b12af88561ad5a3b1fc8f866f49056 (diff)
downloadgit-eeb70b6769ad484989c8708a85fef112726a35e1.zip
git-eeb70b6769ad484989c8708a85fef112726a35e1.tar.gz
git-eeb70b6769ad484989c8708a85fef112726a35e1.tar.bz2
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 <rctay89@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/examples/git-merge.sh')
-rwxr-xr-xcontrib/examples/git-merge.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh
index bab3da9..91e33a3 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