diff options
author | Etienne Samson <samson.etienne@gmail.com> | 2018-04-20 08:38:50 +0000 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-05-07 14:28:20 +0200 |
commit | a82082d0de931ee07391183b12e90da3973f5168 (patch) | |
tree | 984a6f2cd384dac751f019145e784a3e7e156d58 /tests | |
parent | c7964c22b12392c5816121eb28efba0f389a4d0f (diff) | |
download | libgit2-a82082d0de931ee07391183b12e90da3973f5168.tar.gz |
worktree: a worktree can be made from a bare repository
Diffstat (limited to 'tests')
-rw-r--r-- | tests/worktree/worktree.c | 20 |
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; |