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>
This commit is contained in:

committed by
Junio C Hamano

parent
44a3691362
commit
b4d1690df1
@ -517,7 +517,7 @@ static int grep_cache(struct grep_opt *opt, const char **paths, int cached,
|
||||
* are identical, even if worktree file has been modified, so use
|
||||
* cache version instead
|
||||
*/
|
||||
if (cached || (ce->ce_flags & CE_VALID)) {
|
||||
if (cached || (ce->ce_flags & CE_VALID) || ce_skip_worktree(ce)) {
|
||||
if (ce_stage(ce))
|
||||
continue;
|
||||
hit |= grep_sha1(opt, ce->sha1, ce->name, 0);
|
||||
|
Reference in New Issue
Block a user