summaryrefslogtreecommitdiff
path: root/builtin/worktree.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/worktree.c')
-rw-r--r--builtin/worktree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c
index e081ca9bef..1cd5c2016e 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -118,8 +118,10 @@ static void prune_worktrees(void)
struct dirent *d;
if (!dir)
return;
- while ((d = readdir_skip_dot_and_dotdot(dir)) != NULL) {
+ while ((d = readdir(dir)) != NULL) {
char *path;
+ if (is_dot_or_dotdot(d->d_name))
+ continue;
strbuf_reset(&reason);
if (should_prune_worktree(d->d_name, &reason, &path, expire))
prune_worktree(d->d_name, reason.buf);