From 8ef4e11a76599111b98682d235e7a4df921b2597 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Mon, 28 Apr 2014 14:16:26 -0700 Subject: 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. --- src/iterator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/iterator.c') 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); -- cgit v1.2.3