Repository navigation
fix(server): don't report origin/main in repos with no remote - #459
Merged
Merged
Conversation
When `origin/HEAD` is unset, `getOriginDefaultBranch` falls back to probing
`refs/remotes/origin/{main,master}` with `git show-ref --verify --quiet`. That
probe never fails. simple-git decides success partly from stderr, and `--quiet`
tells git to stay silent, so a missing ref resolves instead of rejecting.
Every local-only repository therefore reports `originDefaultBranch:
"origin/main"` from `GET /api/revisions`, and the quick menu offers an
`origin/main...Uncommitted (merge-base)` preset that cannot resolve.
Dropping `--quiet` lets git write `fatal: ... - not a valid ref` to stderr,
which simple-git surfaces as a rejection, so the fallback behaves as intended.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
|
@finnmglas Thank you!! |
yoshiko-pg
enabled auto-merge (squash)
August 28, 2026 14:56
yoshiko-pg
disabled auto-merge
August 28, 2026 14:56
WarLikeLaux
pushed a commit
to WarLikeLaux/difit
that referenced
this pull request
Sep 25, 2026
…o-pg#459) When `origin/HEAD` is unset, `getOriginDefaultBranch` falls back to probing `refs/remotes/origin/{main,master}` with `git show-ref --verify --quiet`. That probe never fails. simple-git decides success partly from stderr, and `--quiet` tells git to stay silent, so a missing ref resolves instead of rejecting. Every local-only repository therefore reports `originDefaultBranch: "origin/main"` from `GET /api/revisions`, and the quick menu offers an `origin/main...Uncommitted (merge-base)` preset that cannot resolve. Dropping `--quiet` lets git write `fatal: ... - not a valid ref` to stderr, which simple-git surfaces as a rejection, so the fallback behaves as intended. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

Hi, first small bugfix commit here, love the tool!
Description: When
origin/HEADis unset,getOriginDefaultBranchfalls back to probingrefs/remotes/origin/{main,master}withgit show-ref --verify --quiet. That probe never fails. simple-git decides success partly from stderr, and--quiettells git to stay silent, so a missing ref resolves instead of rejecting.Impact: Every local-only repository therefore reports
originDefaultBranch: "origin/main"fromGET /api/revisions, and the quick menu offers anorigin/main...Uncommitted (merge-base)preset that cannot resolve.Proposed fix: Dropping
--quietlets git writefatal: ... - not a valid refto stderr, which simple-git surfaces as a rejection, so the fallback behaves as intended.Context: I first found difit last week while building a code-quality tool that also uses npx and interactive htmls based on git data (npx desprawl) :)