Skip to content

Commit fba883f

Browse files
authored
Merge pull request #307 from JanJoris/bugfix/error_on_describe
Removed error thrown by symbolic-ref and describe
2 parents c39da78 + cbd6be9 commit fba883f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

GitUtils.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.Stopwatch]$sw
4646
}
4747

4848
$b = Invoke-NullCoalescing `
49-
{ dbg 'Trying symbolic-ref' $sw; git symbolic-ref HEAD 2>$null } `
49+
{ dbg 'Trying symbolic-ref' $sw; git symbolic-ref HEAD -q 2>$null } `
5050
{ '({0})' -f (Invoke-NullCoalescing `
5151
{
5252
dbg 'Trying describe' $sw
5353
switch ($Global:GitPromptSettings.DescribeStyle) {
5454
'contains' { git describe --contains HEAD 2>$null }
5555
'branch' { git describe --contains --all HEAD 2>$null }
5656
'describe' { git describe HEAD 2>$null }
57-
default { git describe --tags --exact-match HEAD 2>$null }
57+
default { git tag --points-at HEAD 2>$null }
5858
}
5959
} `
6060
{

0 commit comments

Comments
 (0)