Skip to content

Commit

Permalink
Merge pull request #307 from JanJoris/bugfix/error_on_describe
Browse files Browse the repository at this point in the history
Removed error thrown by symbolic-ref and describe
  • Loading branch information
dahlbyk authored Oct 10, 2016
2 parents c39da78 + cbd6be9 commit fba883f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GitUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.Stopwatch]$sw
}

$b = Invoke-NullCoalescing `
{ dbg 'Trying symbolic-ref' $sw; git symbolic-ref HEAD 2>$null } `
{ dbg 'Trying symbolic-ref' $sw; git symbolic-ref HEAD -q 2>$null } `
{ '({0})' -f (Invoke-NullCoalescing `
{
dbg 'Trying describe' $sw
switch ($Global:GitPromptSettings.DescribeStyle) {
'contains' { git describe --contains HEAD 2>$null }
'branch' { git describe --contains --all HEAD 2>$null }
'describe' { git describe HEAD 2>$null }
default { git describe --tags --exact-match HEAD 2>$null }
default { git tag --points-at HEAD 2>$null }
}
} `
{
Expand Down

0 comments on commit fba883f

Please # to comment.