Skip to content

Commit 3e0edd0

Browse files
committed
bugfix: do not crash when the git project is on a junction
1 parent 1b89f76 commit 3e0edd0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Git-NumberedAdd/lib/Parse-GitStatus.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ function Parse-GitStatus($includeNumstat = $false, $extraArgs) {
1919
$hasStaged = $false
2020
$hasWorkingDir = $false
2121

22-
$workingDir = Get-Location
2322
$gitRootdir = Get-GitRootLocation
23+
$workingDirRelative = git rev-parse --show-prefix
24+
if ($workingDirRelative) {
25+
$workingDir = Join-Path $gitRootdir $workingDirRelative
26+
} else {
27+
$workingDir = $gitRootdir
28+
}
2429
# write-host "workingDir=$workingDir"
2530
# write-host "gitRootdir=$gitRootdir"
2631

0 commit comments

Comments
 (0)