Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-06-08 13:55:19 +0400
committerJunio C Hamano <gitster@pobox.com>2007-06-08 13:55:19 +0400
commitabc403f58452da667b261274a1091af61dfec35c (patch)
tree93e073859ddce0d1f2ce9067cb1adf93d73c9b7f /git-checkout.sh
parent16befb8b7fbfcc9b2d38931f4081669558300adf (diff)
parent5035242c4785bd23c53827a1656b5f97394f724e (diff)
Merge branch 'maint'
* maint: checkout: do not get confused with ambiguous tag/branch names
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-xgit-checkout.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-checkout.sh b/git-checkout.sh
index d561c88dcb..33f1e87c0c 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -63,12 +63,13 @@ while [ "$#" != "0" ]; do
echo "unknown flag $arg"
exit 1
fi
- new="$rev"
new_name="$arg"
if git-show-ref --verify --quiet -- "refs/heads/$arg"
then
+ rev=$(git-rev-parse --verify "refs/heads/$arg^0")
branch="$arg"
fi
+ new="$rev"
elif rev=$(git-rev-parse --verify "$arg^{tree}" 2>/dev/null)
then
# checking out selected paths from a tree-ish.