We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fd8068 commit 86db1adCopy full SHA for 86db1ad
src/libgit2/worktree.c
@@ -565,6 +565,7 @@ int git_worktree_is_prunable(git_worktree *wt,
565
git_worktree_prune_options *opts)
566
{
567
git_worktree_prune_options popts = GIT_WORKTREE_PRUNE_OPTIONS_INIT;
568
+ git_buf path = GIT_BUF_INIT;
569
570
GIT_ERROR_CHECK_VERSION(
571
opts, GIT_WORKTREE_PRUNE_OPTIONS_VERSION,
@@ -595,6 +596,14 @@ int git_worktree_is_prunable(git_worktree *wt,
595
596
return 0;
597
}
598
599
+ if (git_buf_printf(&path, "%s/worktrees/%s", wt->commondir_path, wt->name) < 0)
600
+ return 0;
601
+ if (!git_path_exists(path.ptr))
602
+ {
603
+ git_error_set(GIT_ERROR_WORKTREE, "worktree gitdir '%s' does not exist", path.ptr);
604
605
+ }
606
+
607
return 1;
608
609
0 commit comments