Skip to content

Commit

Permalink
Fix display of symbolic ref
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Apr 8, 2012
1 parent e940ca5 commit 4b04981
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions GitUtils.ps1
Expand Up @@ -42,9 +42,9 @@ function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.Stopwatch]$sw
$r = '|BISECTING'
}

$b = '({0})' -f (
Coalesce-Args `
{ dbg 'Trying symbolic-ref' $sw; git symbolic-ref HEAD 2>$null } `
$b = Coalesce-Args `
{ dbg 'Trying symbolic-ref' $sw; git symbolic-ref HEAD 2>$null } `
{ '({0})' -f (Coalesce-Args `
{ dbg 'Trying describe' $sw; git describe --exact-match HEAD 2>$null } `
{
dbg 'Falling back on parsing HEAD' $sw
Expand All @@ -57,9 +57,10 @@ function Get-GitBranch($gitDir = $(Get-GitDirectory), [Diagnostics.Stopwatch]$sw
return 'unknown'
}
}
)
) }
}

dbg 'Inside git directory?' $sw
if ('true' -eq $(git rev-parse --is-inside-git-dir 2>$null)) {
dbg 'Inside git directory' $sw
if ('true' -eq $(git rev-parse --is-bare-repository 2>$null)) {
Expand Down

0 comments on commit 4b04981

Please sign in to comment.