summaryrefslogtreecommitdiff
path: root/builtin-fetch-pack.c
diff options
context:
space:
mode:
authorKjetil Barvik <barvik@broadpark.no>2009-03-04 17:47:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-08 04:25:16 (GMT)
commitc06ff4908bf9ad8bf2448439a3574321c9399b17 (patch)
tree269f1fcbb4c60ceeccdc4dcf1f270d1f3f72d977 /builtin-fetch-pack.c
parente1afca4fd3e7cb4000874e991277f10119de4ad2 (diff)
downloadgit-c06ff4908bf9ad8bf2448439a3574321c9399b17.zip
git-c06ff4908bf9ad8bf2448439a3574321c9399b17.tar.gz
git-c06ff4908bf9ad8bf2448439a3574321c9399b17.tar.bz2
Record ns-timestamps if possible, but do not use it without USE_NSEC
Traditionally, the lack of USE_NSEC meant "do not record nor use the nanosecond resolution part of the file timestamps". To avoid problems on filesystems that lose the ns part when the metadata is flushed to the disk and then later read back in, disabling USE_NSEC has been a good idea in general. If you are on a filesystem without such an issue, it does not hurt to read and store them in the cached stat data in the index entries even if your git is compiled without USE_NSEC. The index left with such a version of git can be read by git compiled with USE_NSEC and it can make use of the nanosecond part to optimize the check to see if the path on the filesystem hsa been modified since we last looked at. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-fetch-pack.c')
-rw-r--r--builtin-fetch-pack.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index 3b210c7..59b0b0a 100644
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
@@ -801,9 +801,7 @@ struct ref *fetch_pack(struct fetch_pack_args *my_args,
int fd;
mtime.sec = st.st_mtime;
-#ifdef USE_NSEC
- mtime.nsec = st.st_mtim.tv_nsec;
-#endif
+ mtime.nsec = ST_MTIME_NSEC(st);
if (stat(shallow, &st)) {
if (mtime.sec)
die("shallow file was removed during fetch");