diff options
author | Russell Belfer <rb@github.com> | 2014-04-28 14:04:29 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-05-02 09:21:32 -0700 |
commit | 240f4af321612a0fe4cf01aed75a8cb44173feb8 (patch) | |
tree | d92455ee46456a2de161b1128b0555e9a6e43401 /src/iterator.c | |
parent | 6a1ca96e4193f79c16c6a71dd8b5d576acf22e91 (diff) | |
download | libgit2-240f4af321612a0fe4cf01aed75a8cb44173feb8.tar.gz |
Add build option for diff internal statistics
Diffstat (limited to 'src/iterator.c')
-rw-r--r-- | src/iterator.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/iterator.c b/src/iterator.c index ef27fa71f..5e668b50c 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -1017,6 +1017,8 @@ static int fs_iterator__expand_dir(fs_iterator *fi) return GIT_ENOTFOUND; } + GIT_PERF_ADD(fi->base.stat_calls, ff->entries.length); + fs_iterator__seek_frame_start(fi, ff); ff->next = fi->stack; @@ -1304,9 +1306,11 @@ static int workdir_iterator__enter_dir(fs_iterator *fi) /* convert submodules to GITLINK and remove trailing slashes */ git_vector_foreach(&ff->entries, pos, entry) { - if (S_ISDIR(entry->st.st_mode) && - git_submodule__is_submodule(fi->base.repo, entry->path)) - { + if (!S_ISDIR(entry->st.st_mode)) + continue; + + GIT_PERF_INC(fi->base.submodule_lookups); + if (git_submodule__is_submodule(fi->base.repo, entry->path)) { entry->st.st_mode = GIT_FILEMODE_COMMIT; entry->path_len--; entry->path[entry->path_len] = '\0'; |