summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/worktree/worktree.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/worktree/worktree.c b/tests/worktree/worktree.c
index 70ccd506f..cbdd0847d 100644
--- a/tests/worktree/worktree.c
+++ b/tests/worktree/worktree.c
@@ -228,6 +228,26 @@ void test_worktree_worktree__init(void)
git_repository_free(repo);
}
+void test_worktree_worktree__add_from_bare(void)
+{
+ git_worktree *wt;
+ git_repository *repo, *wtrepo;
+
+ repo = cl_git_sandbox_init("short_tag.git");
+
+ cl_assert_equal_i(1, git_repository_is_bare(repo));
+ cl_assert_equal_i(0, git_repository_is_worktree(repo));
+
+ cl_git_pass(git_worktree_add(&wt, repo, "worktree-frombare", "worktree-frombare", NULL));
+ cl_git_pass(git_repository_open(&wtrepo, "worktree-frombare"));
+ cl_assert_equal_i(0, git_repository_is_bare(wtrepo));
+ cl_assert_equal_i(1, git_repository_is_worktree(wtrepo));
+
+ git_worktree_free(wt);
+ git_repository_free(repo);
+ git_repository_free(wtrepo);
+}
+
void test_worktree_worktree__add_locked(void)
{
git_worktree *wt;