diff options
author | Russell Belfer <rb@github.com> | 2014-04-28 14:16:26 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-05-02 09:21:32 -0700 |
commit | 8ef4e11a76599111b98682d235e7a4df921b2597 (patch) | |
tree | bf6bfa00b776587e85d7cd3d3244d1e3a9778a0b /tests/diff/workdir.c | |
parent | 240f4af321612a0fe4cf01aed75a8cb44173feb8 (diff) | |
download | libgit2-8ef4e11a76599111b98682d235e7a4df921b2597.tar.gz |
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 'tests/diff/workdir.c')
-rw-r--r-- | tests/diff/workdir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c index 03a3ff418..84c8866e0 100644 --- a/tests/diff/workdir.c +++ b/tests/diff/workdir.c @@ -67,8 +67,8 @@ void test_diff_workdir__to_index(void) #ifdef GIT_PERF cl_assert_equal_sz( 13 /* in root */ + 3 /* in subdir */, diff->stat_calls); - cl_assert_equal_sz(9, diff->oid_calculations); - cl_assert_equal_sz(2, diff->submodule_lookups); + cl_assert_equal_sz(5, diff->oid_calculations); + cl_assert_equal_sz(1, diff->submodule_lookups); #endif } |