]> git.droids-corp.org - git-central.git/commitdiff
Don't complain if checking out something like a hash.
authorStephen Haberman <stephen@exigencecorp.com>
Mon, 25 Aug 2008 14:45:46 +0000 (09:45 -0500)
committerStephen Haberman <stephen@exigencecorp.com>
Mon, 25 Aug 2008 16:29:03 +0000 (11:29 -0500)
client/post-checkout-rebase

index 613b97ecf3068ec3007c7a25e8921eaa4a4cf968..40ee5233eb9e9eb2afe36f702da68f6e272dbc61 100644 (file)
@@ -5,9 +5,12 @@
 # whether the checkout was a branch checkout (changing branches, flag=1) or a
 # file checkout (retrieving a file from the index, flag=0).
 
-branch=$(git symbolic-ref HEAD)
-branch=${branch/refs\/heads\//}
+branch=$(git symbolic-ref --quiet HEAD)
+if [ $? -ne 0 ] ; then
+       exit 0
+fi
 
+branch=${branch/refs\/heads\//}
 git config --list | grep "branch.${branch}.rebase" > /dev/null
 if [ $? -ne 0 ] ; then
        git config --add "branch.${branch}.rebase" true