Skip to content
Browse files

Bring back call to symbolic-ref so that branch names are preferred ov…

…er tags. Closes #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...
1 parent e035163 commit 83dfee0b16e0d8e603f9ff0e119df2eaead94b01 @tgmayfield tgmayfield committed with dahlbyk Feb 9, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 GitUtils.ps1
1 GitUtils.ps1
@@ -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

0 comments on commit 83dfee0

Please sign in to comment.
Something went wrong with that request. Please try again.