File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -234,37 +234,30 @@ void git_worktree_free(git_worktree *wt)
234234
235235int git_worktree_validate (const git_worktree * wt )
236236{
237- int err = 0 ;
238-
239237 assert (wt );
240238
241239 if (!is_worktree_dir (wt -> gitdir_path )) {
242240 giterr_set (GITERR_WORKTREE ,
243241 "Worktree gitdir ('%s') is not valid" ,
244242 wt -> gitlink_path );
245- err = -1 ;
246- goto out ;
243+ return GIT_ERROR ;
247244 }
248245
249246 if (wt -> parent_path && !git_path_exists (wt -> parent_path )) {
250247 giterr_set (GITERR_WORKTREE ,
251248 "Worktree parent directory ('%s') does not exist " ,
252249 wt -> parent_path );
253- err = -2 ;
254- goto out ;
250+ return GIT_ERROR ;
255251 }
256252
257253 if (!git_path_exists (wt -> commondir_path )) {
258254 giterr_set (GITERR_WORKTREE ,
259255 "Worktree common directory ('%s') does not exist " ,
260256 wt -> commondir_path );
261- err = -3 ;
262- goto out ;
257+ return GIT_ERROR ;
263258 }
264259
265- out :
266-
267- return err ;
260+ return 0 ;
268261}
269262
270263int git_worktree_add_init_options (git_worktree_add_options * opts ,
You can’t perform that action at this time.
0 commit comments