Skip to content

Commit

Permalink
untracked cache: print stats with $GIT_TRACE_UNTRACKED_STATS
Browse files Browse the repository at this point in the history
This could be used to verify correct behavior in tests

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Mar 12, 2015
1 parent ed4efab commit c9ccb5d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1923,6 +1923,18 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const stru
free_simplify(simplify);
qsort(dir->entries, dir->nr, sizeof(struct dir_entry *), cmp_name);
qsort(dir->ignored, dir->ignored_nr, sizeof(struct dir_entry *), cmp_name);
if (dir->untracked) {
static struct trace_key trace_untracked_stats = TRACE_KEY_INIT(UNTRACKED_STATS);
trace_printf_key(&trace_untracked_stats,
"node creation: %u\n"
"gitignore invalidation: %u\n"
"directory invalidation: %u\n"
"opendir: %u\n",
dir->untracked->dir_created,
dir->untracked->gitignore_invalidated,
dir->untracked->dir_invalidated,
dir->untracked->dir_opened);
}
return dir->nr;
}

Expand Down

0 comments on commit c9ccb5d

Please sign in to comment.