| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1476,6 +1476,17 @@ def test_git_work_tree_from_bare_repo(self, rw_dir): | |||
| 1476 | 1476 | assert not repo.bare | |
| 1477 | 1477 | assert osp.samefile(repo.working_tree_dir, worktree_path) | |
| 1478 | 1478 | ||
| 1479 | + # Discovering from a subdirectory (as tools such as mkdocs plugins do) and then | ||
| 1480 | + # running a command with an absolute pathspec must use the worktree, not the | ||
| 1481 | + # bare common dir, as the working directory; 3.1.61 failed here with | ||
| 1482 | + # "is outside repository at '<bare_repo>/.'" (#2223). | ||
| 1483 | + subdir = osp.join(worktree_path, "git", "repo") | ||
| 1484 | + sub_repo = Repo(subdir, search_parent_directories=True) | ||
| 1485 | + assert not sub_repo.bare | ||
| 1486 | + assert osp.samefile(sub_repo.working_dir, worktree_path) | ||
| 1487 | + expected = repo.git.log("-n", "1", "--format=%H", "--", "git/repo") | ||
| 1488 | + assert sub_repo.git.log("-n", "1", "--format=%H", "--", subdir) == expected | ||
| 1489 | + | ||
| 1479 | 1490 | def test_git_work_tree_dotgit_relative(self): | |
| 1480 | 1491 | """Check that we find .git as a worktree file containing a relative path | |
| 1481 | 1492 | and find the worktree based on it.""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments