summaryrefslogtreecommitdiff
path: root/git-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-02 16:58:30 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-02 16:58:30 -0800
commit3683dc5a9afaf88d00e55c9e6c67a2160ca7fc9c (patch)
tree644cbf283f249555f275196515a23479e3c5c223 /git-merge.sh
parent22b1c7ee01ef5bc7f81e620bb88a6fad79c1c605 (diff)
downloadgit-3683dc5a9afaf88d00e55c9e6c67a2160ca7fc9c.tar.gz
git-merge: fix confusion between tag and branch
In a repository with core.warnambiguousrefs turned off, and with a branch and a tag that have the same name 'frotz', git merge frotz would merge the commit pointed at by the tag 'frotz' but incorrectly would identify what was merged as 'branch frotz' in the merge message. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-xgit-merge.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/git-merge.sh b/git-merge.sh
index 75af10d3e4..272f004622 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -189,13 +189,13 @@ else
merge_name=$(for remote
do
rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null) &&
- if git show-ref -q --verify "refs/heads/$remote"
+ bh=$(git show-ref -s --verify "refs/heads/$remote") &&
+ if test "$rh" = "$bh"
then
- what=branch
+ echo "$rh branch '$remote' of ."
else
- what=commit
- fi &&
- echo "$rh $what '$remote'"
+ echo "$rh commit '$remote'"
+ fi
done | git-fmt-merge-msg
)
merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name"