提交 aa9349d4 编写于 作者: M Marius Storm-Olsen 提交者: Junio C Hamano

Add shortcut in refresh_cache_ent() for marked entries.

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: NMarius Storm-Olsen <marius@trolltech.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 b7f685a7
......@@ -893,6 +893,15 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册