summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b7f685a)
raw | patch | inline | side by side (parent: b7f685a)
author | Marius Storm-Olsen <marius@trolltech.com> | |
Fri, 30 May 2008 12:38:35 +0000 (14:38 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 31 May 2008 21:18:20 +0000 (14:18 -0700) |
When a cache entry has been marked as CE_VALID, the user has
promised us that any change in the work tree does not matter.
Just mark the entry as up-to-date, and continue.
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
promised us that any change in the work tree does not matter.
Just mark the entry as up-to-date, and continue.
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
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 ac9a8e7e323bb7b0728b2b199ab4f4a9bc5ce22f..8e5fbb619295fe3e4d950e8926d8034d6f825e41 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
if (ce_uptodate(ce))
return ce;
+ /*
+ * CE_VALID means the user promised us that the change to
+ * the work tree does not matter and told us not to worry.
+ */
+ if (!ignore_valid && (ce->ce_flags & CE_VALID)) {
+ ce_mark_uptodate(ce);
+ return ce;
+ }
+
if (lstat(ce->name, &st) < 0) {
if (err)
*err = errno;