Skip to content

Remember when a branch shares no history with the base [patch] - #107

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/105-cache-unrelated-histories
Oct 30, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/105-cache-unrelated-histories

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #105

What changed

MirrorQueries.FindMergeBaseAsync cached 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 /state request.

Tests

  • FindMergeBaseAsync_UnrelatedHistories_RunsGitOnce: a second lookup spawns no git merge-base. It fails on main (2 invocations) and passes with this change.
  • FindMergeBaseAsync_AnError_IsNotRemembered: exit 128 is still retried. The existing timeout test covers the timed-out case.
  • Checked by hand that git 2.43 exits 1 with empty stdout for two unrelated commits.
  • Full suite: 282/282 passed.

Generated by Claude Code

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
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants