aboutsummaryrefslogtreecommitdiff
path: root/git-checkout-script
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-11 18:32:30 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-11 18:32:30 -0700
commit714fff2aa8979c5dd169481909a364a860481f0e (patch)
treedc793fc1dda0243de0db0c63217cea57117d8e3d /git-checkout-script
parent79162bb8ad43aefb23172b9f164ea13ac2b60744 (diff)
downloadgit-714fff2aa8979c5dd169481909a364a860481f0e.tar.gz
git-714fff2aa8979c5dd169481909a364a860481f0e.tar.xz
Make "git checkout" verify that the argument refers to a commit
We still need to create a new branch if it didn't refer to an existing branch, otherwise our HEAD will continue to point to something totally different than what we just checked out. I'll need to think about it. Maybe only do it with "-f" and force it to the "master" branch?
Diffstat (limited to 'git-checkout-script')
-rwxr-xr-xgit-checkout-script2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-checkout-script b/git-checkout-script
index bf52e3bb2..48e1da939 100755
--- a/git-checkout-script
+++ b/git-checkout-script
@@ -13,7 +13,7 @@ while [ "$#" != "0" ]; do
force=1
;;
*)
- rev=$(git-rev-parse --verify --revs-only "$arg")
+ rev=$(git-rev-parse --verify --revs-only "$arg^0") || exit
if [ -z "$rev" ]; then
echo "unknown flag $arg"
exit 1