Skip to content

Commit 4a6b2f3

Browse files
codexByron
authored andcommitted
test: skip bare worktree regression on old Git
The regression relies on git worktree, which was introduced in Git 2.5.1. Skip it on older installations, matching the neighboring worktree coverage. Validation: focused regression passed; ruff check and ruff format --check passed.
1 parent d3cb53c commit 4a6b2f3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

test/test_repo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,9 @@ def test_git_work_tree_dotgit(self, rw_dir, use_relative_paths=False):
14611461

14621462
@with_rw_directory
14631463
def test_git_work_tree_from_bare_repo(self, rw_dir):
1464+
if Git().version_info[:3] < (2, 5, 1):
1465+
pytest.skip("worktree feature unsupported, needs git 2.5.1 or later")
1466+
14641467
bare_repo = self.rorepo.clone(join_path_native(rw_dir, "bare_repo"), bare=True)
14651468
worktree_path = join_path_native(rw_dir, "worktree_repo")
14661469
bare_repo.git.worktree("add", "--detach", worktree_path)

0 commit comments

Comments
 (0)