diff options
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 |