summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-08-20 13:46:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-08-24 00:13:32 (GMT)
commitb4d1690df11ae6ce382b93778616b1a20f1774ff (patch)
tree63ba6b306c569dc59c24361ebb72ac1f081b8f0e /read-cache.c
parent44a3691362dc71241a5d68d90b07642c46992e4a (diff)
downloadgit-b4d1690df11ae6ce382b93778616b1a20f1774ff.zip
git-b4d1690df11ae6ce382b93778616b1a20f1774ff.tar.gz
git-b4d1690df11ae6ce382b93778616b1a20f1774ff.tar.bz2
Teach Git to respect skip-worktree bit (reading part)
grep: turn on --cached for files that is marked skip-worktree ls-files: do not check for deleted file that is marked skip-worktree update-index: ignore update request if it's skip-worktree, while still allows removing diff*: skip worktree version Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/read-cache.c b/read-cache.c
index 4e3e272..5ee7d9d 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -265,7 +265,7 @@ int ie_match_stat(const struct index_state *istate,
* If it's marked as always valid in the index, it's
* valid whatever the checked-out copy says.
*/
- if (!ignore_valid && (ce->ce_flags & CE_VALID))
+ if (!ignore_valid && ((ce->ce_flags & CE_VALID) || ce_skip_worktree(ce)))
return 0;
/*
@@ -1004,11 +1004,7 @@ 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)) {
+ if (!ignore_valid && ((ce->ce_flags & CE_VALID) || ce_skip_worktree(ce))) {
ce_mark_uptodate(ce);
return ce;
}