Repository navigation
Remember when a branch shares no history with the base [patch] - #107
Merged
Merged
Conversation
FindMergeBaseAsync cached only a found merge base, so an orphan branch such as gh-pages re-ran a full-history git merge-base on every /state request. Exit code 1 with no output is now cached as "no merge base"; timeouts and other errors are still retried. Fixes #105 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW3f2Szc4ZLoCTbPhuX
|
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.



Fixes #105
What changed
MirrorQueries.FindMergeBaseAsynccached a merge base only when it found one. When a branch has no common history with the base (gh-pages, an orphan assets branch), git has to walk both histories in full to report that, and the service re-ran that walk on every/staterequest.git merge-baseexits 1 with no output and does not time out, the result is cached as "no merge base" under the same(directory, first, second)key. It uses an empty-string sentinel, which no object id can be. Callers still getnull.Tests
FindMergeBaseAsync_UnrelatedHistories_RunsGitOnce: a second lookup spawns nogit merge-base. It fails onmain(2 invocations) and passes with this change.FindMergeBaseAsync_AnError_IsNotRemembered: exit 128 is still retried. The existing timeout test covers the timed-out case.Generated by Claude Code