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>
Junio C Hamano committed
Dec 2, 2006 at 16:58 UTC
3683dc5a9afaf88d00e55c9e6c67a2160ca7fc9c
1 file changed
+5
-5
git-merge.sh
+5
-5
@@ -189,13 +189,13 @@ else
189
merge_name=$(for remote
190
do
191
rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null) &&
192
- if git show-ref -q --verify "refs/heads/$remote"
192
+ bh=$(git show-ref -s --verify "refs/heads/$remote") &&
193
+ if test "$rh" = "$bh"
194
then
194
- what=branch
195
+ echo "$rh branch '$remote' of ."
196
else
196
- what=commit
197
- fi &&
198
- echo "$rh $what '$remote'"
197
+ echo "$rh commit '$remote'"
198
+ fi
199
done | git-fmt-merge-msg
200
)
201
merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name"