-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Problem
The Invoke-Git
function in lib/core.ps1
does not properly propagate Git process exit codes when using the Start-Job proxy path. Callers that check $LASTEXITCODE
after Invoke-Git
operations see the job/cmdlet status instead of the underlying Git exit code.
Root Cause
In the proxy path (Start-Job … & $using:git
), the job's exit code isn't marshaled back to the parent shell. The current implementation only returns the output but doesn't capture or set the Git process exit code.
Impact
This affects multiple parts of the codebase that rely on $LASTEXITCODE
after Invoke-Git
calls:
- lib/buckets.ps1 (lines 149–153, 156–160) – checks on
$LASTEXITCODE
afterInvoke-Git
forls-remote
andclone
- libexec/scoop-status.ps1 (lines 24–28) – sets
$script:network_failure
from$LASTEXITCODE
afterfetch
- bin/auto-pr.ps1 (lines 108–112, 136–140, 158–162) – multiple
if ($LASTEXITCODE -gt 0)
guards
Expected Behavior
All callers should reliably observe Git's exit status under both proxy and non-proxy configurations.
Context
This issue was identified during code review of PR #6370 which adds historical manifest search functionality. The issue is separate from that PR's scope.
Related: