Skip to content

Commit

Permalink
If abbreviating git dir, display correct path on a bare repo
Browse files Browse the repository at this point in the history
  • Loading branch information
RexTremendae committed Oct 3, 2020
1 parent d94feed commit fb69b09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ function Get-PromptPath {
# Look up the git root
if ($abbrevGitDir) {
$gitPath = Get-GitDirectory
# Up one level from `.git`
if ($gitPath) { $gitPath = Split-Path $gitPath -Parent }
# Up one level from `.git` if inside git directory
if ($gitPath -and $gitPath.EndsWith(".git")) { $gitPath = Split-Path $gitPath -Parent }
}

# Abbreviate path under a git repository as "<repo-name>:<relative-path>"
Expand Down

0 comments on commit fb69b09

Please sign in to comment.