From 2128eaf3167981089ff1bc780918ef0ad74b4f2f Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Mon, 25 Aug 2008 09:45:46 -0500 Subject: [PATCH] Don't complain if checking out something like a hash. --- client/post-checkout-rebase | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/post-checkout-rebase b/client/post-checkout-rebase index 613b97e..40ee523 100644 --- a/client/post-checkout-rebase +++ b/client/post-checkout-rebase @@ -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 -- 2.20.1