worktree.c: use is_dot_or_dotdot()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7b722d906b
commit
afb9e30b2c
@ -95,7 +95,7 @@ static void prune_worktrees(void)
|
||||
if (!dir)
|
||||
return;
|
||||
while ((d = readdir(dir)) != NULL) {
|
||||
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
|
||||
if (is_dot_or_dotdot(d->d_name))
|
||||
continue;
|
||||
strbuf_reset(&reason);
|
||||
if (!prune_worktree(d->d_name, &reason))
|
||||
|
@ -187,7 +187,7 @@ struct worktree **get_worktrees(void)
|
||||
if (dir) {
|
||||
while ((d = readdir(dir)) != NULL) {
|
||||
struct worktree *linked = NULL;
|
||||
if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
|
||||
if (is_dot_or_dotdot(d->d_name))
|
||||
continue;
|
||||
|
||||
if ((linked = get_linked_worktree(d->d_name))) {
|
||||
|
Loading…
Reference in New Issue
Block a user