summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-11-28 12:25:00 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-11-28 12:25:00 -0700
commitd071d7a26dd2698f47407fabec8460282bf01f2b (patch)
tree88a1ac3cc8719664737e4327f6cddc805178e77b /lib
parent81fab3d8df43cd4f68328a5a3ba505aa772147e5 (diff)
downloaddotfiles-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-xlib/hooks/git/dotfiles/post-checkout3
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