diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-11-28 12:25:00 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-11-28 12:25:00 -0700 |
commit | d071d7a26dd2698f47407fabec8460282bf01f2b (patch) | |
tree | 88a1ac3cc8719664737e4327f6cddc805178e77b /lib | |
parent | 81fab3d8df43cd4f68328a5a3ba505aa772147e5 (diff) | |
download | dotfiles-d071d7a26dd2698f47407fabec8460282bf01f2b.tar.gz |
dotfiles post-checkout hook should not use git-name-rev
When there is another branch pointing to the same commit as master,
git-name-rev might output that branch's name, rather than 'master'.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/hooks/git/dotfiles/post-checkout | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/hooks/git/dotfiles/post-checkout b/lib/hooks/git/dotfiles/post-checkout index 8ee87e32..24f733e7 100755 --- a/lib/hooks/git/dotfiles/post-checkout +++ b/lib/hooks/git/dotfiles/post-checkout @@ -1,7 +1,6 @@ #!/bin/sh -head="$2" -branch="$(git name-rev --name-only $head)" +branch="$(git symbolic-ref --short HEAD)" if [ "$branch" = "master" ]; then git config commit.gpgsign true |