Follow-up to #2223 / #2224, which fixed Repo treating a linked worktree of a bare repository as bare. The existing regression test checks repo.bare and working_tree_dir when Repo() is opened on the worktree root. This adds the two steps that actually broke for us in 3.1.61 and are not exercised yet:
discovery from a subdirectory with search_parent_directories=True (how tools such as mkdocs-git-revision-date-localized-plugin open the repo), asserting working_dir is the worktree rather than the bare common dir;
running a git command with an absolute pathspec through repo.git, which on 3.1.61 failed with:
fatal: '<worktree>/docs' is outside repository at '<bare_repo>/.'
Our CI checks every job out as a linked worktree of a shared bare repository (git --git-dir=<bare> worktree add <job-dir> <sha>), so this was the shape that took down our documentation builds when the build image picked up 3.1.61. The new assertions pass on main (with 180b1ff) and fail on 3.1.61.
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
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.
Follow-up to #2223 / #2224, which fixed Repo treating a linked worktree of a bare repository as bare. The existing regression test checks repo.bare and working_tree_dir when Repo() is opened on the worktree root. This adds the two steps that actually broke for us in 3.1.61 and are not exercised yet:
discovery from a subdirectory with search_parent_directories=True (how tools such as mkdocs-git-revision-date-localized-plugin open the repo), asserting working_dir is the worktree rather than the bare common dir;
running a git command with an absolute pathspec through repo.git, which on 3.1.61 failed with:
Our CI checks every job out as a linked worktree of a shared bare repository (git --git-dir=<bare> worktree add <job-dir> <sha>), so this was the shape that took down our documentation builds when the build image picked up 3.1.61. The new assertions pass on main (with 180b1ff) and fail on 3.1.61.
No behavior change; test only.