diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-10-24 00:33:08 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-10-24 00:33:08 +0400 |
commit | e03a5010b3fc17a1d559ae0fdbcdad63af8e30c9 (patch) | |
tree | 54ec5075e4781875b4d10cc91860a0247b0d4d2d /builtin | |
parent | 74051fa805b2b4aa6a0c2e6d4663dc8969e80967 (diff) | |
parent | 680be044d98b3b703bc33d546a987c19b3779aeb (diff) |
Merge branch 'jc/ls-files-killed-optim' into maint
"git ls-files -k" needs to crawl only the part of the working tree
that may overlap the paths in the index to find killed files, but
shared code with the logic to find all the untracked files, which
made it unnecessarily inefficient.
* jc/ls-files-killed-optim:
dir.c::test_one_path(): work around directory_exists_in_index_icase() breakage
t3010: update to demonstrate "ls-files -k" optimization pitfalls
ls-files -k: a directory only can be killed if the index has a non-directory
dir.c: use the cache_* macro to access the current index
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/ls-files.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 5cf3e31370..85004460bd 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -219,6 +219,8 @@ static void show_files(struct dir_struct *dir) /* For cached/deleted files we don't need to even do the readdir */ if (show_others || show_killed) { + if (!show_others) + dir->flags |= DIR_COLLECT_KILLED_ONLY; fill_directory(dir, pathspec); if (show_others) show_other_files(dir); |