summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEtienne Samson <samson.etienne@gmail.com>2018-04-20 08:38:50 +0000
committerPatrick Steinhardt <ps@pks.im>2018-05-07 14:28:20 +0200
commita82082d0de931ee07391183b12e90da3973f5168 (patch)
tree984a6f2cd384dac751f019145e784a3e7e156d58 /tests
parentc7964c22b12392c5816121eb28efba0f389a4d0f (diff)
downloadlibgit2-a82082d0de931ee07391183b12e90da3973f5168.tar.gz
worktree: a worktree can be made from a bare repository
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;