summaryrefslogtreecommitdiff
path: root/tests/status/worktree.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/status/worktree.c')
-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));