clone every branch so commits outside the default branch resolve #917

Merged
moritz merged 2 commits from feat/clone_all_branches into main 2026-09-07 14:34:29 +00:00
Member

abra app new <commit> fails for any commit that isn't on the default branch:

FATA unable to resolve 'abcd123': reference not found

Clone() passes SingleBranch: true, so go-git persists +refs/heads/main:refs/remotes/origin/main in .git/config. Other branches never get fetched, and a later git fetch doesn't help because the narrow refspec stays.

  • drop SingleBranch from both clone attempts
  • pass the refspec explicitly in EnsureUpToDate(), so repos cloned by an older abra repair themselves on the next fetch

Single-branch wasn't even smaller. The server sends its existing packfile instead of computing a custom one:

recipe single-branch all branches
gitea 472K 328K
nextcloud 676K 448K
`abra app new <commit>` fails for any commit that isn't on the default branch: FATA unable to resolve 'abcd123': reference not found `Clone()` passes `SingleBranch: true`, so go-git persists `+refs/heads/main:refs/remotes/origin/main` in `.git/config`. Other branches never get fetched, and a later `git fetch` doesn't help because the narrow refspec stays. - drop `SingleBranch` from both clone attempts - pass the refspec explicitly in `EnsureUpToDate()`, so repos cloned by an older abra repair themselves on the next fetch Single-branch wasn't even smaller. The server sends its existing packfile instead of computing a custom one: | recipe | single-branch | all branches | |---|---|---| | gitea | 472K | 328K | | nextcloud | 676K | 448K |
moritz added 1 commit 2026-08-31 19:33:18 +00:00
fix(git): clone every branch so commits outside the default branch resolve
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
643a551da3
moritz added 1 commit 2026-09-01 08:54:10 +00:00
p4u1 approved these changes 2026-09-01 12:35:39 +00:00
p4u1 left a comment
Owner

Lgtm, @decentral1se do you remember why the SingleBramch option was added in the first place?

Lgtm, @decentral1se do you remember why the SingleBramch option was added in the first place?
Owner

I have no idea at all even tho I did it 🙃 I'd run the integration test suite to check 😛

Someone else click the merge button finally!

I have no idea at all even tho I did it 🙃 I'd run the integration test suite to check 😛 Someone else click the merge button finally!
moritz merged commit 27ca0cd21e into main 2026-09-07 14:34:29 +00:00
moritz deleted branch feat/clone_all_branches 2026-09-07 14:34:31 +00:00
Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#917