summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-12-03 15:18:21 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-12-03 15:19:09 -0700
commit8baf7ec7416ee01dad6ca97eb014494cf357659a (patch)
treefe28ab19980c60015bc9663fb5de43e255063af8 /lib
parent6bc34c592fde01820a2361d8f100e4d822b16d34 (diff)
downloaddotfiles-8baf7ec7416ee01dad6ca97eb014494cf357659a.tar.gz
don't fail on detached HEAD
Diffstat (limited to 'lib')
-rwxr-xr-xlib/hooks/git/dotfiles/post-checkout6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/hooks/git/dotfiles/post-checkout b/lib/hooks/git/dotfiles/post-checkout
index e6488382..21b007cc 100755
--- a/lib/hooks/git/dotfiles/post-checkout
+++ b/lib/hooks/git/dotfiles/post-checkout
@@ -1,6 +1,10 @@
#!/bin/sh
-branch="$(git symbolic-ref --short HEAD)"
+branch="$(git symbolic-ref --quiet --short HEAD)"
+if ! [ $? = 0 ]; then # detached HEAD
+ git config commit.gpgsign false
+ exit 0
+fi
# Check that signing is likely to succeed before setting
# commit.gpgsign, by looking for presence of a secret key with the