Skip to content

Commit

Permalink
Bring back call to symbolic-ref so that branch names are preferred ov…
Browse files Browse the repository at this point in the history
…er tags. Closes dahlbyk#30

- git describe can pull a tag name instead of branch name
- symbolic-ref fails for tag names (so git describe is used instead)
- this code branch is only hit when EnableFileStatus is false or the branch name isn't found in 'git status'
  • Loading branch information
tgmayfield authored and dahlbyk committed Feb 13, 2012
1 parent e035163 commit 83dfee0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions GitUtils.ps1
Expand Up @@ -44,6 +44,7 @@ function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.Stopwatch]$sw

$b = '({0})' -f (
Coalesce-Args `
{ dbg 'Trying symbolic-ref' $sw; git symbolic-ref HEAD 2>$null } `
{ dbg 'Trying describe' $sw; git describe --exact-match HEAD 2>$null } `
{
dbg 'Falling back on parsing HEAD' $sw
Expand Down

0 comments on commit 83dfee0

Please sign in to comment.