summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 077c48d)
raw | patch | inline | side by side (parent: 077c48d)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Jan 2008 08:44:50 +0000 (00:44 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 23 Jan 2008 05:26:40 +0000 (21:26 -0800) |
This moves a common boolean expression into a helper function,
and makes the comparison between filesystem timestamp and index
timestamp done in the function in line with the other places.
st.st_mtime should be casted to (unsigned int) when compared to
an index timestamp ce_mtime.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
and makes the comparison between filesystem timestamp and index
timestamp done in the function in line with the other places.
st.st_mtime should be casted to (unsigned int) when compared to
an index timestamp ce_mtime.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c | patch | blob | history |
diff --git a/read-cache.c b/read-cache.c
index 8f5d02afaa1265205db5d1ad2a5d5ed3232cce5b..07abd5d7ebfc10998a3c6140a7a325d752d70b49 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
return changed;
}
+static int is_racy_timestamp(struct index_state *istate, struct cache_entry *ce)
+{
+ return (istate->timestamp &&
+ ((unsigned int)istate->timestamp) <= ce->ce_mtime);
+}
+
int ie_match_stat(struct index_state *istate,
struct cache_entry *ce, struct stat *st,
unsigned int options)
* whose mtime are the same as the index file timestamp more
* carefully than others.
*/
- if (!changed &&
- istate->timestamp &&
- istate->timestamp <= ce->ce_mtime) {
+ if (!changed && is_racy_timestamp(istate, ce)) {
if (assume_racy_is_modified)
changed |= DATA_CHANGED;
else
struct cache_entry *ce = cache[i];
if (ce->ce_flags & CE_REMOVE)
continue;
- if (istate->timestamp &&
- istate->timestamp <= ce->ce_mtime)
+ if (is_racy_timestamp(istate, ce))
ce_smudge_racily_clean_entry(ce);
if (ce_write_entry(&c, newfd, ce) < 0)
return -1;