Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Rasmussen <axelrasmussen@google.com>2015-08-29 23:59:20 +0300
committerAxel Rasmussen <axelrasmussen@google.com>2015-09-19 09:33:56 +0300
commit0226f7dd36c990e9bc1632adbc655fefc797513a (patch)
tree7077e9792dc75e9b7d74813914e2fe08010a8d0d /tests/index
parent360dd4dafd30bced1dab1d516765e347d09b91ba (diff)
diff/index: respect USE_NSEC for racily clean file detection
Diffstat (limited to 'tests/index')
-rw-r--r--tests/index/racy.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/index/racy.c b/tests/index/racy.c
index 3b26aabf4..df25c851c 100644
--- a/tests/index/racy.c
+++ b/tests/index/racy.c
@@ -63,10 +63,10 @@ void test_index_racy__write_index_just_after_file(void)
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "A"));
cl_git_mkfile(path.ptr, "A");
/* Force the file's timestamp to be a second after we wrote the index */
- times[0].tv_sec = index->stamp.mtime + 1;
- times[0].tv_usec = 0;
- times[1].tv_sec = index->stamp.mtime + 1;
- times[1].tv_usec = 0;
+ times[0].tv_sec = index->stamp.mtime.tv_sec + 1;
+ times[0].tv_usec = index->stamp.mtime.tv_nsec / 1000;
+ times[1].tv_sec = index->stamp.mtime.tv_sec + 1;
+ times[1].tv_usec = index->stamp.mtime.tv_nsec / 1000;
cl_git_pass(p_utimes(path.ptr, times));
/*
@@ -82,10 +82,10 @@ void test_index_racy__write_index_just_after_file(void)
* Pretend this index' modification happend a second after the
* file update, and rewrite the file in that same second.
*/
- times[0].tv_sec = index->stamp.mtime + 2;
- times[0].tv_usec = 0;
- times[1].tv_sec = index->stamp.mtime + 2;
- times[0].tv_usec = 0;
+ times[0].tv_sec = index->stamp.mtime.tv_sec + 2;
+ times[0].tv_usec = index->stamp.mtime.tv_nsec / 1000;
+ times[1].tv_sec = index->stamp.mtime.tv_sec + 2;
+ times[0].tv_usec = index->stamp.mtime.tv_nsec / 1000;
cl_git_pass(p_utimes(git_index_path(index), times));
cl_git_pass(p_utimes(path.ptr, times));