diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-09-12 02:03:28 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-12 02:03:28 +0400 |
commit | 4c4d9d9b654db3eecb6e1107e814a737eafce0d6 (patch) | |
tree | 986cc418ff474dd998c2ceeb0d3652dc502dfd92 /builtin | |
parent | 135be1ee2b6cc5b006974e38111990f0e22accd5 (diff) | |
parent | 680be044d98b3b703bc33d546a987c19b3779aeb (diff) |
Merge branch 'jc/ls-files-killed-optim'
"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 d4823c9d38..e1cf6d8547 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -220,6 +220,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); |