diff options
author | Patrick Steinhardt <ps@pks.im> | 2015-10-15 15:58:05 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2017-02-13 10:28:15 +0100 |
commit | 79ab3ef69f4905a548bd3a301c348a48454c48f7 (patch) | |
tree | a707b6af1e5ed933366acfe5ea1118551e343160 /tests/worktree/open.c | |
parent | c5f3da9692f8de15550fed47e377c586f99f7c5a (diff) | |
download | libgit2-79ab3ef69f4905a548bd3a301c348a48454c48f7.tar.gz |
repository: introduce is_worktree variable
Diffstat (limited to 'tests/worktree/open.c')
-rw-r--r-- | tests/worktree/open.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/worktree/open.c b/tests/worktree/open.c index 772f7601f..54a8af4a3 100644 --- a/tests/worktree/open.c +++ b/tests/worktree/open.c @@ -1,4 +1,5 @@ #include "clar_libgit2.h" +#include "repository.h" #include "worktree_helpers.h" #define WORKTREE_PARENT "submodules-worktree-parent" @@ -13,6 +14,9 @@ void test_worktree_open__repository(void) cl_assert(git_repository_path(fixture.worktree) != NULL); cl_assert(git_repository_workdir(fixture.worktree) != NULL); + cl_assert(!fixture.repo->is_worktree); + cl_assert(fixture.worktree->is_worktree); + cleanup_fixture_worktree(&fixture); } @@ -39,6 +43,9 @@ void test_worktree_open__submodule_worktree_parent(void) cl_assert(git_repository_path(fixture.worktree) != NULL); cl_assert(git_repository_workdir(fixture.worktree) != NULL); + cl_assert(!fixture.repo->is_worktree); + cl_assert(fixture.worktree->is_worktree); + cleanup_fixture_worktree(&fixture); } @@ -55,6 +62,10 @@ void test_worktree_open__submodule_worktree_child(void) "submodules/testrepo/.git")); setup_fixture_worktree(&child_fixture); + cl_assert(!parent_fixture.repo->is_worktree); + cl_assert(parent_fixture.worktree->is_worktree); + cl_assert(child_fixture.worktree->is_worktree); + cleanup_fixture_worktree(&child_fixture); cleanup_fixture_worktree(&parent_fixture); } |