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:
authorEdward Thomson <ethomson@microsoft.com>2015-06-16 22:18:04 +0300
committerEdward Thomson <ethomson@microsoft.com>2015-06-16 22:32:02 +0300
commit121c3171e5b4918337910250487691efa8dbbd49 (patch)
tree7b3e78726836b9ff0163d1291c7aabb7c2b136f2 /tests/checkout
parente44abe16bd20512c76331e6889f390e35993153a (diff)
Introduce p_utimes and p_futimes
Provide functionality to set the time on a filesystem entry, using utimes or futimes on POSIX type systems or SetFileTime on Win32.
Diffstat (limited to 'tests/checkout')
-rw-r--r--tests/checkout/checkout_helpers.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/checkout/checkout_helpers.c b/tests/checkout/checkout_helpers.c
index c2e65b885..f6e36d39b 100644
--- a/tests/checkout/checkout_helpers.c
+++ b/tests/checkout/checkout_helpers.c
@@ -132,8 +132,9 @@ int checkout_count_callback(
void tick_index(git_index *index)
{
+ int index_fd;
git_time_t ts;
- struct timespec times[2];
+ struct timeval times[2];
cl_assert(index->on_disk);
cl_assert(git_index_path(index));
@@ -141,10 +142,11 @@ void tick_index(git_index *index)
cl_git_pass(git_index_read(index, true));
ts = index->stamp.mtime;
- times[0].tv_sec = UTIME_OMIT; /* dont' change the atime */
- times[0].tv_nsec = UTIME_OMIT; /* dont' change the atime */
+ times[0].tv_sec = ts;
+ times[0].tv_usec = 0;
times[1].tv_sec = ts + 1;
- times[1].tv_nsec = 0;
- cl_git_pass(p_utimensat(AT_FDCWD, git_index_path(index), times, 0));
+ times[1].tv_usec = 0;
+
+ cl_git_pass(p_utimes(git_index_path(index), times));
cl_git_pass(git_index_read(index, true));
}