Commit 688cd6d2 authored by Duy Nguyen's avatar Duy Nguyen Committed by Junio C Hamano

status: only touch path we may need to check

This patch gets rid of whole-tree cache refresh and untracked file
search. Instead only specified path will be looked at.

Again some numbers on gentoo-x86, ~80k files:

Unmodified Git:

$ time git st eclass/
nothing to commit (working directory clean)

real    0m3.211s
user    0m1.977s
sys     0m1.135s

Modified Git:

$ time ~/w/git/git st eclass/
nothing to commit (working directory clean)

real    0m1.587s
user    0m1.426s
sys     0m0.111s
Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 1f73566a
......@@ -1023,7 +1023,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
s.pathspec = get_pathspec(prefix, argv);
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, s.pathspec, NULL, NULL);
s.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;
s.in_merge = in_merge;
......@@ -343,7 +343,7 @@ static void wt_status_collect_untracked(struct wt_status *s)
fill_directory(&dir, NULL);
fill_directory(&dir, s->pathspec);
for (i = 0; i <; i++) {
struct dir_entry *ent = dir.entries[i];
if (!cache_name_is_other(ent->name, ent->len))
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment