Fix Open Knowledge Desktop offering to set up a project inside a…#337
Merged
Conversation
…ject root (#2204) discoverProject's linked-worktree carveout used resolveGitDirDetailed, which walks up to the worktree root's .git pointer when the picked path has no .git of its own. A subfolder of a linked worktree therefore resolved to kind 'linked' and short-circuited to in-place Setup, scaffolding .ok/ inside the subfolder instead of promoting to the git root. Guard the carveout on projectSubPath === '' so it fires only when the picked path IS the worktree root; subfolders fall through to the ancestor-walk and git-root promotion. Adds a regression test for the subfolder case (RED before the fix) and one pinning that the worktree root still classifies standalone under an ancestor .ok/. GitOrigin-RevId: f16356c3a59f9a0939565c9a86678c47b94f1e61
Contributor
There was a problem hiding this comment.
Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28268055689). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.
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.
Fix Open Knowledge Desktop offering to set up a project inside a subfolder of a linked git worktree. Picking a subdirectory (for example
public/open-knowledge) inside agit worktree addcheckout misclassified it as a worktree root and showed "Setup Open Knowledge in this folder" in place, scaffolding.ok/in the subfolder instead of promoting to the git root. Subfolders of a linked worktree now correctly fall through to git-root promotion; only the worktree root itself is treated as a standalone project.