diff options
| author | Miguel Arroz <750683+arroz@users.noreply.github.com> | 2022-08-30 18:08:23 -0700 |
|---|---|---|
| committer | Miguel Arroz <750683+arroz@users.noreply.github.com> | 2022-08-30 18:08:23 -0700 |
| commit | ff0df3aed91364705ec114981b9bd9e590c26f93 (patch) | |
| tree | 81414ab7908f09a2021e8d18608495b29209caf4 /src/libgit2 | |
| parent | 22f382539d78f69aa91721ad62bbd7229750a043 (diff) | |
| download | libgit2-ff0df3aed91364705ec114981b9bd9e590c26f93.tar.gz | |
#6366: When a worktree is missing, return GIT_ENOTFOUND.
Diffstat (limited to 'src/libgit2')
| -rw-r--r-- | src/libgit2/worktree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libgit2/worktree.c b/src/libgit2/worktree.c index 2ac2274f1..82e1d2d7e 100644 --- a/src/libgit2/worktree.c +++ b/src/libgit2/worktree.c @@ -187,6 +187,11 @@ int git_worktree_lookup(git_worktree **out, git_repository *repo, const char *na 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; |
