summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wt-status.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/wt-status.c b/wt-status.c
index 54b6b03..fc2438f 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -390,11 +390,9 @@ static void wt_status_collect_untracked(struct wt_status *s)
fill_directory(&dir, s->pathspec);
for (i = 0; i < dir.nr; i++) {
struct dir_entry *ent = dir.entries[i];
- if (!cache_name_is_other(ent->name, ent->len))
- continue;
- if (!match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL))
- continue;
- string_list_insert(&s->untracked, ent->name);
+ if (cache_name_is_other(ent->name, ent->len) &&
+ match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL))
+ string_list_insert(&s->untracked, ent->name);
free(ent);
}
@@ -404,11 +402,9 @@ static void wt_status_collect_untracked(struct wt_status *s)
fill_directory(&dir, s->pathspec);
for (i = 0; i < dir.nr; i++) {
struct dir_entry *ent = dir.entries[i];
- if (!cache_name_is_other(ent->name, ent->len))
- continue;
- if (!match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL))
- continue;
- string_list_insert(&s->ignored, ent->name);
+ if (cache_name_is_other(ent->name, ent->len) &&
+ match_pathspec(s->pathspec, ent->name, ent->len, 0, NULL))
+ string_list_insert(&s->ignored, ent->name);
free(ent);
}
}