mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #48883 from terminalmage/salt-jenkins-1023
Fix failing git worktree tests
This commit is contained in:
commit
0ca0b6f2f2
1 changed files with 5 additions and 4 deletions
|
@ -619,8 +619,6 @@ class GitModuleTest(ModuleCase):
|
|||
|
||||
shutil.rmtree(new_repo)
|
||||
|
||||
# Test for git.is_worktree is in test_worktree_add_rm
|
||||
|
||||
def test_list_branches(self):
|
||||
'''
|
||||
Test git.list_branches
|
||||
|
@ -943,6 +941,7 @@ class GitModuleTest(ModuleCase):
|
|||
worktree_path = tempfile.mkdtemp(dir=TMP)
|
||||
worktree_basename = os.path.basename(worktree_path)
|
||||
worktree_path2 = tempfile.mkdtemp(dir=TMP)
|
||||
worktree_basename2 = os.path.basename(worktree_path2)
|
||||
|
||||
# Even though this is Windows, git commands return a unix style path
|
||||
if salt.utils.is_windows():
|
||||
|
@ -953,11 +952,13 @@ class GitModuleTest(ModuleCase):
|
|||
ret = self.run_function(
|
||||
'git.worktree_add', [self.repo, worktree_path],
|
||||
)
|
||||
self.assertTrue(worktree_add_prefix + worktree_path in ret)
|
||||
self.assertTrue(worktree_add_prefix in ret)
|
||||
self.assertTrue(worktree_basename in ret)
|
||||
ret = self.run_function(
|
||||
'git.worktree_add', [self.repo, worktree_path2]
|
||||
)
|
||||
self.assertTrue(worktree_add_prefix + worktree_path2 in ret)
|
||||
self.assertTrue(worktree_add_prefix in ret)
|
||||
self.assertTrue(worktree_basename2 in ret)
|
||||
# Check if this new path is a worktree
|
||||
self.assertTrue(self.run_function('git.is_worktree', [worktree_path]))
|
||||
# Check if the main repo is a worktree
|
||||
|
|
Loading…
Add table
Reference in a new issue