summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7371a2)
raw | patch | inline | side by side (parent: d7371a2)
author | Kjetil Barvik <barvik@broadpark.no> | |
Sun, 15 Mar 2009 11:38:55 +0000 (12:38 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 15 Mar 2009 19:56:40 +0000 (12:56 -0700) |
Commit e1afca4fd "write_index(): update index_state->timestamp after
flushing to disk" on 2009-02-23 used stat.ctime to record the
timestamp of the index-file. This is wrong, so fix this and use the
correct stat.mtime timestamp instead.
Commit 110c46a909 "Not all systems use st_[cm]tim field for ns
resolution file timestamp" on 2009-03-08, has a similar bug for the
builtin-fetch-pack.c file.
Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
flushing to disk" on 2009-02-23 used stat.ctime to record the
timestamp of the index-file. This is wrong, so fix this and use the
correct stat.mtime timestamp instead.
Commit 110c46a909 "Not all systems use st_[cm]tim field for ns
resolution file timestamp" on 2009-03-08, has a similar bug for the
builtin-fetch-pack.c file.
Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch-pack.c | patch | blob | history | |
read-cache.c | patch | blob | history |
diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index 1d7e02326f5d0da5533ef92c3b1b31c61cef9758..8b3386168138691b2b3a3938156249cb00a3a714 100644 (file)
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
die("shallow file was removed during fetch");
} else if (st.st_mtime != mtime.sec
#ifdef USE_NSEC
- || ST_CTIME_NSEC(st) != mtime.nsec
+ || ST_MTIME_NSEC(st) != mtime.nsec
#endif
)
die("shallow file was changed during fetch");
diff --git a/read-cache.c b/read-cache.c
index 7f74c8d16126ec72bba98bd5b31da0f37f499691..3f587110cb9d7be1890b7db68a0bdac35d48cd35 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
if (ce_flush(&c, newfd) || fstat(newfd, &st))
return -1;
- istate->timestamp.sec = (unsigned int)st.st_ctime;
- istate->timestamp.nsec = ST_CTIME_NSEC(st);
+ istate->timestamp.sec = (unsigned int)st.st_mtime;
+ istate->timestamp.nsec = ST_MTIME_NSEC(st);
return 0;
}