diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-05-27 13:59:39 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-05-27 14:02:37 +0900 |
| commit | 1df046bcff6085f3800088c51e344594f822df57 (patch) | |
| tree | 1bb0c3c0aca95201393debdba3b58602f1167027 /worktree.c | |
| parent | dir: introduce readdir_skip_dot_and_dotdot() helper (diff) | |
| download | git-1df046bcff6085f3800088c51e344594f822df57.tar.gz git-1df046bcff6085f3800088c51e344594f822df57.zip | |
Revert "dir: introduce readdir_skip_dot_and_dotdot() helper"
This reverts commit b548f0f1568f6b01e55ca69c24d3cb19489f92aa,
to be replaced with a reworked version.
Diffstat (limited to '')
| -rw-r--r-- | worktree.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/worktree.c b/worktree.c index 237517baee..f35ac40a84 100644 --- a/worktree.c +++ b/worktree.c @@ -128,8 +128,10 @@ struct worktree **get_worktrees(void) dir = opendir(path.buf); strbuf_release(&path); if (dir) { - while ((d = readdir_skip_dot_and_dotdot(dir)) != NULL) { + while ((d = readdir(dir)) != NULL) { struct worktree *linked = NULL; + if (is_dot_or_dotdot(d->d_name)) + continue; if ((linked = get_linked_worktree(d->d_name))) { ALLOC_GROW(list, counter + 1, alloc); @@ -484,9 +486,13 @@ int submodule_uses_worktrees(const char *path) if (!dir) return 0; - d = readdir_skip_dot_and_dotdot(dir); - if (d != NULL) + while ((d = readdir(dir)) != NULL) { + if (is_dot_or_dotdot(d->d_name)) + continue; + ret = 1; + break; + } closedir(dir); return ret; } |
