summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-14 01:01:23 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-12-14 01:01:23 (GMT)
commit9954f5b876abb6118f9bdf1d113239d86acca7bd (patch)
tree50edc92b146245437339503752285b3120605b0e
parent0a8b4def9ae9e929a3310b536782a80a7c7644e7 (diff)
downloadgit-9954f5b876abb6118f9bdf1d113239d86acca7bd.zip
git-9954f5b876abb6118f9bdf1d113239d86acca7bd.tar.gz
git-9954f5b876abb6118f9bdf1d113239d86acca7bd.tar.bz2
[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>
-rwxr-xr-xgit-merge.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-merge.sh b/git-merge.sh
index a221daa..d25ae4b 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -97,11 +97,14 @@ head=$(git-rev-parse --verify "$1"^0) || usage
shift
# All the rest are remote heads
+remoteheads=
for remote
do
- git-rev-parse --verify "$remote"^0 >/dev/null ||
+ remotehead=$(git-rev-parse --verify "$remote"^0) ||
die "$remote - not something we can merge"
+ remoteheads="${remoteheads}$remotehead "
done
+set x $remoteheads ; shift
case "$#" in
1)