vendor/libgit2/src/worktree.c in rugged-1.1.0 vs vendor/libgit2/src/worktree.c in rugged-1.1.1

- old
+ new

@@ -257,10 +257,17 @@ git_error_set(GIT_ERROR_WORKTREE, "worktree common directory ('%s') does not exist ", 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; } int git_worktree_add_options_init(git_worktree_add_options *opts, unsigned int version)