diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-16 08:51:45 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-16 08:51:45 +0200 |
commit | e44abe16bd20512c76331e6889f390e35993153a (patch) | |
tree | 8a36e5be8f9a2c32d65a77796b919bbfcf77da07 /tests/diff/workdir.c | |
parent | c4e6ab5f23819c35dc0c1a0fd7f50e5a194f0d5a (diff) | |
download | libgit2-e44abe16bd20512c76331e6889f390e35993153a.tar.gz |
tests: tick the index when we count OID calculations
These tests want to test that we don't recalculate entries which match
the index already. This is however something we force when truncating
racily-clean entries.
Tick the index forward as we know that we don't perform the
modifications which the racily-clean code is trying to avoid.
Diffstat (limited to 'tests/diff/workdir.c')
-rw-r--r-- | tests/diff/workdir.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c index 5d6ebed95..6b72f3286 100644 --- a/tests/diff/workdir.c +++ b/tests/diff/workdir.c @@ -2,6 +2,7 @@ #include "diff_helpers.h" #include "repository.h" #include "git2/sys/diff.h" +#include "../checkout/checkout_helpers.h" static git_repository *g_repo = NULL; @@ -1583,6 +1584,7 @@ void test_diff_workdir__can_update_index(void) git_diff_options opts = GIT_DIFF_OPTIONS_INIT; git_diff *diff = NULL; git_diff_perfdata perf = GIT_DIFF_PERFDATA_INIT; + git_index *index; g_repo = cl_git_sandbox_init("status"); @@ -1607,6 +1609,10 @@ void test_diff_workdir__can_update_index(void) /* now allow diff to update stat cache */ opts.flags |= GIT_DIFF_UPDATE_INDEX; + /* advance a tick for the index so we don't re-calculate racily-clean entries */ + cl_git_pass(git_repository_index__weakptr(&index, g_repo)); + tick_index(index); + basic_diff_status(&diff, &opts); cl_git_pass(git_diff_get_perfdata(&perf, diff)); |