Skip to content

Commit afb9e30

Browse files
pcloudsgitster
authored andcommitted
worktree.c: use is_dot_or_dotdot()
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Reviewed-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7b722d9 commit afb9e30

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/worktree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static void prune_worktrees(void)
9595
if (!dir)
9696
return;
9797
while ((d = readdir(dir)) != NULL) {
98-
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
98+
if (is_dot_or_dotdot(d->d_name))
9999
continue;
100100
strbuf_reset(&reason);
101101
if (!prune_worktree(d->d_name, &reason))

worktree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ struct worktree **get_worktrees(void)
187187
if (dir) {
188188
while ((d = readdir(dir)) != NULL) {
189189
struct worktree *linked = NULL;
190-
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
190+
if (is_dot_or_dotdot(d->d_name))
191191
continue;
192192

193193
if ((linked = get_linked_worktree(d->d_name))) {

0 commit comments

Comments
 (0)