summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/libgit2/worktree/worktree.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/libgit2/worktree/worktree.c b/tests/libgit2/worktree/worktree.c
index 9fd27f49c..fed5c9259 100644
--- a/tests/libgit2/worktree/worktree.c
+++ b/tests/libgit2/worktree/worktree.c
@@ -645,3 +645,16 @@ void test_worktree_worktree__validate_invalid_worktreedir(void)
git_worktree_free(wt);
}
+
+void test_worktree_worktree__is_prunable_missing_repo(void)
+{
+ git_worktree *wt;
+
+ cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
+ p_rename("testrepo", "testrepo-tmp");
+ /* Should not be prunable since the repository moved */
+ cl_assert(!git_worktree_is_prunable(wt, NULL));
+ p_rename("testrepo-tmp", "testrepo");
+
+ git_worktree_free(wt);
+}