@matheusbsbs / matheus-bagliano / commits / 9954f5b876
Fork 0

[PATCH] allow merging any committish

Although "git-merge" is advertised as the end-user level command (instead of being a "git-pull" backend), it was not prepared to take tag objects that point at commits and barfed when fed one. Sanitize the input while we validate them, for which we already have a loop. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Dec 13, 2005 at 17:01 UTC 9954f5b876abb6118f9bdf1d113239d86acca7bd
1 file changed +4 -1
git-merge.sh
+4 -1
@@ -97,11 +97,14 @@ head=$(git-rev-parse --verify "$1"^0) || usage
97 shift
98
99 # All the rest are remote heads
100 +remoteheads=
101 for remote
102 do
102 - git-rev-parse --verify "$remote"^0 >/dev/null ||
103 + remotehead=$(git-rev-parse --verify "$remote"^0) ||
104 die "$remote - not something we can merge"
105 + remoteheads="${remoteheads}$remotehead "
106 done
107 +set x $remoteheads ; shift
108
109 case "$#" in
110 1)