diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-03 15:18:21 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-12-03 15:19:09 -0700 |
commit | 8baf7ec7416ee01dad6ca97eb014494cf357659a (patch) | |
tree | fe28ab19980c60015bc9663fb5de43e255063af8 /lib | |
parent | 6bc34c592fde01820a2361d8f100e4d822b16d34 (diff) | |
download | dotfiles-8baf7ec7416ee01dad6ca97eb014494cf357659a.tar.gz |
don't fail on detached HEAD
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/hooks/git/dotfiles/post-checkout | 6 |
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 |