File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ int git_worktree_validate(const git_worktree *wt)
248248 goto out ;
249249 }
250250
251- if (!git_path_exists (wt -> parent_path )) {
251+ if (wt -> parent_path && !git_path_exists (wt -> parent_path )) {
252252 giterr_set (GITERR_WORKTREE ,
253253 "Worktree parent directory ('%s') does not exist " ,
254254 wt -> parent_path );
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ void test_worktree_bare__add(void)
4242 cl_git_pass (git_worktree_list (& wts , g_repo ));
4343 cl_assert_equal_i (wts .count , 1 );
4444
45+ cl_git_pass (git_worktree_validate (wt ));
46+
4547 cl_git_pass (git_repository_open (& wtrepo , WORKTREE_REPO ));
4648 cl_assert_equal_i (0 , git_repository_is_bare (wtrepo ));
4749 cl_assert_equal_i (1 , git_repository_is_worktree (wtrepo ));
You can’t perform that action at this time.
0 commit comments