Commit 83c35f7e by Etienne Samson

tests: worktree/bare: fix git_worktree_validate

parent bd40f0d7
......@@ -248,7 +248,7 @@ int git_worktree_validate(const git_worktree *wt)
goto out;
}
if (!git_path_exists(wt->parent_path)) {
if (wt->parent_path && !git_path_exists(wt->parent_path)) {
giterr_set(GITERR_WORKTREE,
"Worktree parent directory ('%s') does not exist ",
wt->parent_path);
......
......@@ -42,6 +42,8 @@ void test_worktree_bare__add(void)
cl_git_pass(git_worktree_list(&wts, g_repo));
cl_assert_equal_i(wts.count, 1);
cl_git_pass(git_worktree_validate(wt));
cl_git_pass(git_repository_open(&wtrepo, WORKTREE_REPO));
cl_assert_equal_i(0, git_repository_is_bare(wtrepo));
cl_assert_equal_i(1, git_repository_is_worktree(wtrepo));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment