summaryrefslogtreecommitdiff
path: root/src/worktree.c
diff options
context:
space:
mode:
authorReginald McLean <rbmclean00@gmail.com>2020-11-06 11:36:25 -0500
committerReginald McLean <rbmclean00@gmail.com>2020-11-06 11:36:25 -0500
commit6405ce29753000e84d485d18d6b0fde893a38f84 (patch)
tree5e998097a687d57217f33f478904b9485c890649 /src/worktree.c
parent848c7793d41a594e7b503fe0bc956b79c95295d6 (diff)
downloadlibgit2-6405ce29753000e84d485d18d6b0fde893a38f84.tar.gz
worktree: Added worktree_dir check
Fixes #5280
Diffstat (limited to 'src/worktree.c')
-rw-r--r--src/worktree.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/worktree.c b/src/worktree.c
index fda9b0b71..ea5a403c0 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -259,7 +259,14 @@ int git_worktree_validate(const git_worktree *wt)
wt->commondir_path);
return GIT_ERROR;
}
-
+
+ if (!git_path_exists(wt->worktree_path)) {
+ git_error_set(GIT_ERROR_WORKTREE,
+ "worktree directory ('%s') does not exist ",
+ wt->worktree_path);
+ return GIT_ERROR;
+ }
+
return 0;
}