vendor/libgit2/src/libgit2/worktree.c in rugged-1.5.1 vs vendor/libgit2/src/libgit2/worktree.c in rugged-1.6.2

- old
+ new

@@ -185,9 +185,14 @@ *out = NULL; if ((error = git_str_join3(&path, '/', repo->commondir, "worktrees", name)) < 0) goto out; + if (!git_fs_path_isdir(path.ptr)) { + error = GIT_ENOTFOUND; + goto out; + } + if ((error = (open_worktree_dir(out, git_repository_workdir(repo), path.ptr, name))) < 0) goto out; out: git_str_dispose(&path);