Skip to content

Commit 0fd8068

Browse files
rbmcleanethomson
authored andcommitted
Added missing is_prunable test
1 parent 9d41a3f commit 0fd8068

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/libgit2/worktree/worktree.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,3 +645,16 @@ void test_worktree_worktree__validate_invalid_worktreedir(void)
645645

646646
git_worktree_free(wt);
647647
}
648+
649+
void test_worktree_worktree__is_prunable_missing_repo(void)
650+
{
651+
git_worktree *wt;
652+
653+
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
654+
p_rename("testrepo", "testrepo-tmp");
655+
/* Should not be prunable since the repository moved */
656+
cl_assert(!git_worktree_is_prunable(wt, NULL));
657+
p_rename("testrepo-tmp", "testrepo");
658+
659+
git_worktree_free(wt);
660+
}

0 commit comments

Comments
 (0)