diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-08-20 20:46:58 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-08-23 17:13:32 -0700 |
commit | b4d1690df11ae6ce382b93778616b1a20f1774ff (patch) | |
tree | 63ba6b306c569dc59c24361ebb72ac1f081b8f0e /diff-lib.c | |
parent | 44a3691362dc71241a5d68d90b07642c46992e4a (diff) | |
download | git-b4d1690df11ae6ce382b93778616b1a20f1774ff.tar.gz |
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 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/diff-lib.c b/diff-lib.c index 22da66ef14..b0b379d9d2 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -159,7 +159,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option) continue; } - if (ce_uptodate(ce)) + if (ce_uptodate(ce) || ce_skip_worktree(ce)) continue; /* If CE_VALID is set, don't look at workdir for file removal */ @@ -339,7 +339,8 @@ static void do_oneway_diff(struct unpack_trees_options *o, int match_missing, cached; /* if the entry is not checked out, don't examine work tree */ - cached = o->index_only || (idx && (idx->ce_flags & CE_VALID)); + cached = o->index_only || + (idx && ((idx->ce_flags & CE_VALID) || ce_skip_worktree(idx))); /* * Backward compatibility wart - "diff-index -m" does * not mean "do not ignore merges", but "match_missing". |