summaryrefslogtreecommitdiff
path: root/tests/status
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-06-16 08:51:45 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-16 08:51:45 +0200
commite44abe16bd20512c76331e6889f390e35993153a (patch)
tree8a36e5be8f9a2c32d65a77796b919bbfcf77da07 /tests/status
parentc4e6ab5f23819c35dc0c1a0fd7f50e5a194f0d5a (diff)
downloadlibgit2-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/status')
-rw-r--r--tests/status/worktree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/status/worktree.c b/tests/status/worktree.c
index 3b18ae6c0..f8d1f7f54 100644
--- a/tests/status/worktree.c
+++ b/tests/status/worktree.c
@@ -6,6 +6,7 @@
#include "util.h"
#include "path.h"
#include "../diff/diff_helpers.h"
+#include "../checkout/checkout_helpers.h"
#include "git2/sys/diff.h"
/**
@@ -956,6 +957,7 @@ void test_status_worktree__update_stat_cache_0(void)
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
git_status_list *status;
git_diff_perfdata perf = GIT_DIFF_PERFDATA_INIT;
+ git_index *index;
opts.flags = GIT_STATUS_OPT_DEFAULTS;
@@ -967,6 +969,10 @@ void test_status_worktree__update_stat_cache_0(void)
git_status_list_free(status);
+ /* tick the index so we avoid recalculating racily-clean entries */
+ cl_git_pass(git_repository_index__weakptr(&index, repo));
+ tick_index(index);
+
opts.flags |= GIT_STATUS_OPT_UPDATE_INDEX;
cl_git_pass(git_status_list_new(&status, repo, &opts));