Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-29 01:16:26 +0400
committerRussell Belfer <rb@github.com>2014-05-02 20:21:32 +0400
commit8ef4e11a76599111b98682d235e7a4df921b2597 (patch)
treebf6bfa00b776587e85d7cd3d3244d1e3a9778a0b /src/iterator.c
parent240f4af321612a0fe4cf01aed75a8cb44173feb8 (diff)
Skip diff oid calc when size definitely changed
When we think the stat cache in the index seems valid and the size or mode of a file has definitely changed, then don't bother trying to recalculate the OID of the workdir bits to confirm that it is modified - just accept that it is modified. This can result in files that show as modified with no actual diff, but the behavior actually appears to match Git on the command line. This also includes a minor optimization to not perform a submodule lookup on the ".git" directory itself.
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/iterator.c b/src/iterator.c
index 5e668b50c..03058b956 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -1306,7 +1306,7 @@ 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))
+ if (!S_ISDIR(entry->st.st_mode) || !strcmp(GIT_DIR, entry->path))
continue;
GIT_PERF_INC(fi->base.submodule_lookups);