diff options
Diffstat (limited to 'builtin/worktree.c')
-rw-r--r-- | builtin/worktree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c index 60440c4106..b1e8f0534c 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -100,7 +100,8 @@ static int prune_worktree(const char *id, struct strbuf *reason) path[len] = '\0'; if (!file_exists(path)) { free(path); - if (st.st_mtime <= expire) { + if (stat(git_path("worktrees/%s/index", id), &st) || + st.st_mtime <= expire) { strbuf_addf(reason, _("Removing worktrees/%s: gitdir file points to non-existent location"), id); return 1; } else { |