diff options
| author | Patrick Steinhardt <ps@pks.im> | 2018-04-30 09:27:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-30 09:27:47 +0100 |
| commit | b33b6d33c319d847e518179364c8e6676f5faf77 (patch) | |
| tree | 87fb390932e05962f823b6393f56065ba088a37f /tests/worktree/worktree.c | |
| parent | 5ace149434d8609133d59cd21f32c21b753adc3a (diff) | |
| parent | 3da1ad20a3f19fcb4e0eea3f4a08509e5811aca7 (diff) | |
| download | libgit2-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.c | 23 |
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; |
