Skip to content

fix(add): remove checkout_tree call on bare repo during fast-forward - #16

Merged
0x56696B merged 5 commits into
mainfrom
fix/add-ff-bare-repo
May 11, 2026
Merged

0x56696B merged 5 commits into
mainfrom
fix/add-ff-bare-repo

Conversation

@0x56696B

@0x56696B 0x56696B commented May 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • checkout_tree() is illegal on bare repos — pygit2 raises cannot checkout. This operation is not allowed against bare repositories
  • head.set_target() was redundant — HEAD is a symbolic ref pointing to the branch; updating the branch ref is sufficient
  • Removes both calls, keeping only the branch ref update via lookup_reference().set_target()

Test plan

  • Run git-wt add <new-branch> main from inside a bare repo where main has diverged from origin — should fast-forward without crashing
  • Run git-wt add <new-branch> main where main is already up to date — should continue working as before

@0x56696B
0x56696B marked this pull request as ready for review May 5, 2026 10:22
@0x56696B
0x56696B merged commit 6e1eca1 into main May 11, 2026
3 checks passed
@0x56696B
0x56696B deleted the fix/add-ff-bare-repo branch May 11, 2026 13:38
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