Explorar o código

Only run 'git worktree list' when it is available.

Jelmer Vernooij %!s(int64=8) %!d(string=hai) anos
pai
achega
f2fcf99a03
Modificáronse 2 ficheiros con 8 adicións e 0 borrados
  1. 5 0
      NEWS
  2. 3 0
      dulwich/tests/compat/test_repository.py

+ 5 - 0
NEWS

@@ -1,5 +1,10 @@
 0.16.2	UNRELEASED
 
+ TEST FIXES
+
+  * Only run worktree list compat tests against git 2.7.0,
+    when 'git worktree list' was introduced. (Jelmer Vernooij)
+
 0.16.1	2016-12-25
 
  BUG FIXES

+ 3 - 0
dulwich/tests/compat/test_repository.py

@@ -34,6 +34,7 @@ from dulwich.repo import (
     Repo,
     )
 from dulwich.tests.compat.utils import (
+    require_git_version,
     rmtree_ro,
     run_git_or_fail,
     CompatTestCase,
@@ -172,6 +173,8 @@ class WorkingTreeTestCase(ObjectStoreTestCase):
         return worktrees
 
     def test_git_worktree_list(self):
+        # 'git worktree list' was introduced in 2.7.0
+        require_git_version((2, 7, 0))
         output = run_git_or_fail(['worktree', 'list'], cwd=self._repo.path)
         worktrees = self._parse_worktree_list(output)
         self.assertEqual(len(worktrees), self._number_of_working_tree)