Skip to content

fix: prevent server crash on missing repo and resolve credential helper path#170

Merged
LiranCohen merged 2 commits into
mainfrom
fix/error-ux
Mar 3, 2026
Merged

fix: prevent server crash on missing repo and resolve credential helper path#170
LiranCohen merged 2 commits into
mainfrom
fix/error-ux

Conversation

@LiranCohen

Copy link
Copy Markdown
Contributor

Summary

  • Server crash fix: getRepoContext() called process.exit(1) when a repo wasn't found in the DWN, which killed the entire daemon process mid-request. Cloning a nonexistent repo showed fatal: Empty reply from server instead 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 via gitd setup. Now resolves the absolute path to the sibling credential-main.js and invokes it via bun, so push auth works regardless of PATH or gitd setup.

Before (clone nonexistent repo)

fatal: unable to access '...': Empty reply from server

(daemon process crashes and dies)

After

fatal: repository '...' not found

git-remote-did: operation failed for did:dht:abc123/my-repo
Please make sure:
  - The repository exists (create it with `gitd init <name>`)
  - The DID is correct and resolvable
  - The daemon is running (`gitd serve`)

(daemon stays alive)

Build, test, lint

All pass: 1119 tests, 0 failures, 0 lint warnings.

…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.
@LiranCohen LiranCohen merged commit 3136765 into main Mar 3, 2026
4 checks passed
@LiranCohen LiranCohen deleted the fix/error-ux branch March 3, 2026 03:44
@github-actions github-actions Bot mentioned this pull request Mar 3, 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