We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d94feed commit fb69b09Copy full SHA for fb69b09
src/Utils.ps1
@@ -295,8 +295,8 @@ function Get-PromptPath {
295
# Look up the git root
296
if ($abbrevGitDir) {
297
$gitPath = Get-GitDirectory
298
- # Up one level from `.git`
299
- 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 }
300
}
301
302
# Abbreviate path under a git repository as "<repo-name>:<relative-path>"
0 commit comments