Skip to content

fix: use augmented PATH for all git commands in GitWorktreeMainService#107

Merged
amandal0903 merged 2 commits intomainfrom
update-diff-stats
Apr 11, 2026
Merged

fix: use augmented PATH for all git commands in GitWorktreeMainService#107
amandal0903 merged 2 commits intomainfrom
update-diff-stats

Conversation

@amandal0903
Copy link
Copy Markdown
Collaborator

Summary

  • Introduce a static git() helper that wraps execFile with the augmented PATH environment, ensuring git is found when the app is launched from DMG/Finder on macOS (not just for addWorktree which was the only call using it before)
  • Replace all 16 direct execFile('git', ...) calls with the new helper
  • Inject ILogService and log errors in getDiffStats catch block for easier debugging

When launched from DMG/Finder, process.env.PATH is minimal and
doesn't include /opt/homebrew/bin where git-lfs lives. Git LFS
filter failures cause "the remote end hung up unexpectedly" errors,
silently breaking getDiffStats and removeWorktree.

Introduce a static git() helper that routes every execFile('git',...)
call through augmentedEnv(), and wire ILogService into the service
so getDiffStats failures are logged to main.log instead of swallowed.
@amandal0903 amandal0903 merged commit ebe9c11 into main Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant