1
0
mirror of https://github.com/git/git.git synced 2024-09-21 09:42:22 +02:00

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:
Nguyễn Thái Ngọc Duy 2016-05-22 16:33:54 +07:00 committed by Junio C Hamano
parent 7b722d906b
commit afb9e30b2c
2 changed files with 2 additions and 2 deletions

View File

@ -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))

View File

@ -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))) {