Permalink
Browse files

git get current-branch-name returns empty string for detached head

  • Loading branch information...
mjdominus committed Apr 18, 2012
1 parent 9b0c67a commit 8d02014f095b5a5aefead0a4d5b99b77b7b6b734
Showing with 1 addition and 0 deletions.
  1. +1 −0 git-get
View
@@ -15,6 +15,7 @@ $what =~ tr/-/_/;
}
sub current_branch_name {
+ if (_head_detached()) { return "" }
_run("git rev-parse --symbolic-full-name --abbrev-ref HEAD");
}

0 comments on commit 8d02014

Please sign in to comment.