summaryrefslogtreecommitdiff
path: root/tests/index/racy.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/index/racy.c')
-rw-r--r--tests/index/racy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/index/racy.c b/tests/index/racy.c
index ace84d585..68aa46007 100644
--- a/tests/index/racy.c
+++ b/tests/index/racy.c
@@ -178,6 +178,7 @@ static void setup_uptodate_files(void)
{
git_buf path = GIT_BUF_INIT;
git_index *index;
+ const git_index_entry *a_entry;
git_index_entry new_entry = {{0}};
cl_git_pass(git_repository_index(&index, g_repo));
@@ -188,9 +189,12 @@ static void setup_uptodate_files(void)
/* Put 'A' into the index */
cl_git_pass(git_index_add_bypath(index, "A"));
+ cl_assert((a_entry = git_index_get_bypath(index, "A", 0)));
+
/* Put 'B' into the index */
new_entry.path = "B";
new_entry.mode = GIT_FILEMODE_BLOB;
+ git_oid_cpy(&new_entry.id, &a_entry->id);
cl_git_pass(git_index_add(index, &new_entry));
/* Put 'C' into the index */