Repository navigation
fix(cmd): resolve main repo root for pool commands run inside a worktree - #97
Closed
kunchenguid wants to merge 1 commit into
Closed
kunchenguid wants to merge 1 commit into
kunchenguid wants to merge 1 commit into
Conversation
get, status, prune, init, and return's cwd fallback used the current
worktree's own toplevel as the repo root. For repositories without an
origin remote the pool name is hashed from that path, so running any of
these commands inside a managed worktree resolved to a fresh, empty
ghost pool ("No worktrees in pool" right after a successful get).
Route them through the new git.FindMainRepoRoot, which resolves a
linked worktree back to its owning repository (same mechanism destroy
and return-with-path already used), and drop the now-unused
git.FindRepoRoot.
Co-Authored-By: Claude Fable 5 <[email protected]>
Co-authored-by: Kun Chen <[email protected]>
kunchenguid
marked this pull request as ready for review
August 19, 2026 17:23
Owner
Author
|
Speaking as Kun's firstmate: this is the conflict-only rebase of #51 (thanks @thirdreplicator). CI is green (check plus test on ubuntu, macos, and windows). Triggering review. |
Owner
Author
|
No description provided. |
Confidence Score: 5/5The PR appears safe to merge, with the changed commands consistently selecting the owning repository’s pool from linked worktrees. The new wrapper delegates to the existing main-repository resolver, the command changes consistently feed that root into established configuration and pool paths, and the regression test verifies the principal remote-less worktree failure mode. Reviews (1): Last reviewed commit: "fix(cmd): resolve main repo root for poo..." | Re-trigger Greptile |
Owner
Author
Owner
Author
|
No description provided. |
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.
This is a conflict-resolved rebase of #51 onto current
main. It does not close #51.Original PR: #51 (fork head
thirdreplicator:fix/pool-resolution-inside-worktree).Behavior (unchanged from #51)
get,status,prune,init, andreturn(cwd fallback) resolve the owning repository via git-common-dir (FindMainRepoRoot/FindMainRepoRootFrom) so commands run inside a managed worktree use the same pool as the main repo. This matters most when there is noorigin, because the pool name is hashed from the repo path.The e2e regression
TestCommandsInsideWorktreeUseMainRepoPoolcovers a remote-less repo:statusinside the worktree must see the leased worktree,getinside the worktree must acquire from the same pool, and no ghost pool directory may appear.Conflict resolution only
Cherry-pick of
7fd12a0onto currentmainconflicted incmd/get.goandcmd/e2e_test.go:get.go: kept main's--json requires --leaseguard and applied fix(cmd): resolve main repo root for pool commands run inside a worktree #51'sFindMainRepoRoot()call.e2e_test.go: kept main'sentertests and appended fix(cmd): resolve main repo root for pool commands run inside a worktree #51's remote-less pool test.FindRepoRoot()is retained. #51 deleted it because it became unused on that branch; currentmainstill uses it fromenter(added after #51). Changingenterwould expand scope, so it is left as onmain.No other behavior changes.