Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/libgit2/index/nsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ void test_index_nsec__cleanup(void)

static bool try_create_file_with_nsec_timestamp(const char *path)
{
#ifndef GIT_NSEC
GIT_UNUSED(path);
#else
struct stat st;
int try;

Expand All @@ -38,6 +41,7 @@ static bool try_create_file_with_nsec_timestamp(const char *path)
if (st.st_ctime_nsec && st.st_mtime_nsec)
return true;
}
#endif

return false;
}
Expand Down
2 changes: 2 additions & 0 deletions tests/libgit2/index/racy.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ static void setup_race(void)

/* force a race */
entry->mtime.seconds = (int32_t)st.st_mtime;
#ifdef GIT_NSEC
entry->mtime.nanoseconds = (int32_t)st.st_mtime_nsec;
#endif

git_str_dispose(&path);
}
Expand Down
5 changes: 4 additions & 1 deletion tests/libgit2/odb/freshen.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,11 @@ void test_odb_freshen__packed_object(void)
cl_must_pass(p_lstat("testrepo.git/objects/pack/" PACKED_FN, &after));

cl_assert(before.st_atime == after.st_atime);
cl_assert(before.st_atime_nsec == after.st_atime_nsec);
cl_assert(before.st_mtime == after.st_mtime);

#ifdef GIT_NSEC
cl_assert(before.st_atime_nsec == after.st_atime_nsec);
cl_assert(before.st_mtime_nsec == after.st_mtime_nsec);
#endif
}

Loading