fix: prevent server crash on missing repo and resolve credential helper path#170
Merged
Conversation
…er by absolute path Two fixes: 1. getRepoContext() called process.exit(1) when a repo wasn't found. This killed the daemon process when cloning a nonexistent repo, causing 'Empty reply from server' instead of a proper 404. Now throws errors instead — CLI callers still exit via the top-level catch handler, server callers catch and return 404. 2. The credential helper was referenced by bare name which requires it to be on PATH. Now resolves the absolute path to the sibling credential-main.js and invokes it via bun, so push auth works regardless of PATH configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Server crash fix:
getRepoContext()calledprocess.exit(1)when a repo wasn't found in the DWN, which killed the entire daemon process mid-request. Cloning a nonexistent repo showedfatal: Empty reply from serverinstead of a proper 404. Now throws errors instead — the server's existing try/catch handles them gracefully.Credential helper path: The credential helper was referenced by bare name (
git-remote-did-credential) which requires it to be on PATH viagitd setup. Now resolves the absolute path to the siblingcredential-main.jsand invokes it viabun, so push auth works regardless of PATH orgitd setup.Before (clone nonexistent repo)
(daemon process crashes and dies)
After
(daemon stays alive)
Build, test, lint
All pass: 1119 tests, 0 failures, 0 lint warnings.