Commit f25bb508cf7fd4da1427544fb48fba12c3c76e1c

Edward Thomson 2019-01-20T23:52:50

index test: cast times explicitly Cast actual filesystem data to the int32_t that index entries store.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/tests/index/racy.c b/tests/index/racy.c
index e08deae..88b37e1 100644
--- a/tests/index/racy.c
+++ b/tests/index/racy.c
@@ -126,8 +126,8 @@ static void setup_race(void)
 	cl_assert(entry = (git_index_entry *)git_index_get_bypath(index, "A", 0));
 
 	/* force a race */
-	entry->mtime.seconds = st.st_mtime;
-	entry->mtime.nanoseconds = st.st_mtime_nsec;
+	entry->mtime.seconds = (int32_t)st.st_mtime;
+	entry->mtime.nanoseconds = (int32_t)st.st_mtime_nsec;
 
 	git_buf_dispose(&path);
 }