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>
This commit is contained in:
parent
22b1c7ee01
commit
3683dc5a9a
10
git-merge.sh
10
git-merge.sh
@ -189,13 +189,13 @@ else
|
|||||||
merge_name=$(for remote
|
merge_name=$(for remote
|
||||||
do
|
do
|
||||||
rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null) &&
|
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
|
then
|
||||||
what=branch
|
echo "$rh branch '$remote' of ."
|
||||||
else
|
else
|
||||||
what=commit
|
echo "$rh commit '$remote'"
|
||||||
fi &&
|
fi
|
||||||
echo "$rh $what '$remote'"
|
|
||||||
done | git-fmt-merge-msg
|
done | git-fmt-merge-msg
|
||||||
)
|
)
|
||||||
merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name"
|
merge_msg="${merge_msg:+$merge_msg$LF$LF}$merge_name"
|
||||||
|
Loading…
Reference in New Issue
Block a user