summaryrefslogtreecommitdiff
path: root/tests/worktree/worktree.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-04-30 09:27:47 +0100
committerGitHub <noreply@github.com>2018-04-30 09:27:47 +0100
commitb33b6d33c319d847e518179364c8e6676f5faf77 (patch)
tree87fb390932e05962f823b6393f56065ba088a37f /tests/worktree/worktree.c
parent5ace149434d8609133d59cd21f32c21b753adc3a (diff)
parent3da1ad20a3f19fcb4e0eea3f4a08509e5811aca7 (diff)
downloadlibgit2-b33b6d33c319d847e518179364c8e6676f5faf77.tar.gz
Merge pull request #4640 from mkeeler/worktree-convenience2
worktree: add functions to get name and path
Diffstat (limited to 'tests/worktree/worktree.c')
-rw-r--r--tests/worktree/worktree.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/worktree/worktree.c b/tests/worktree/worktree.c
index c79d97ffa..70ccd506f 100644
--- a/tests/worktree/worktree.c
+++ b/tests/worktree/worktree.c
@@ -386,6 +386,29 @@ void test_worktree_worktree__validate(void)
git_worktree_free(wt);
}
+void test_worktree_worktree__name(void)
+{
+ git_worktree *wt;
+
+ cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
+ cl_assert_equal_s(git_worktree_name(wt), "testrepo-worktree");
+
+ git_worktree_free(wt);
+}
+
+void test_worktree_worktree__path(void)
+{
+ git_worktree *wt;
+ git_buf expected_path = GIT_BUF_INIT;
+
+ cl_git_pass(git_buf_joinpath(&expected_path, clar_sandbox_path(), "testrepo-worktree"));
+ cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
+ cl_assert_equal_s(git_worktree_path(wt), expected_path.ptr);
+
+ git_buf_free(&expected_path);
+ git_worktree_free(wt);
+}
+
void test_worktree_worktree__validate_invalid_commondir(void)
{
git_worktree *wt;