diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2015-11-12 19:53:09 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-11-12 19:53:09 +0100 |
| commit | 75a0ccf52fef2cab281de886730cda595d3736aa (patch) | |
| tree | 977b981aca588511e96f20dca4acec983d993a16 /tests/index | |
| parent | 2c26c8679ffc02b6644e20eba9458121b944beb6 (diff) | |
| parent | 28659e50d56bb79460c8a1d2315443267d6e6f66 (diff) | |
| download | libgit2-75a0ccf52fef2cab281de886730cda595d3736aa.tar.gz | |
Merge pull request #3170 from CmdrMoozy/nsec_fix
git_index_entry__init_from_stat: set nsec fields in entry stats
Diffstat (limited to 'tests/index')
| -rw-r--r-- | tests/index/racy.c | 16 |
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)); |
