diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-11-02 13:37:13 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-11-02 13:37:13 -0800 |
commit | 86e67a088c581da4da36acf0edd8c27b1033e51e (patch) | |
tree | ff6c53429e67c4f44f7c7b07cfa8bcb980c7570a /wt-status.c | |
parent | d11ddaff021be8006e71b43a5205c48f2dac7f18 (diff) | |
parent | 98fa473887d0bebd38d568bb07232a336a642dcf (diff) | |
download | git-86e67a088c581da4da36acf0edd8c27b1033e51e.tar.gz git-86e67a088c581da4da36acf0edd8c27b1033e51e.tar.xz |
Merge branch 'jk/maint-ls-files-other' into maint
* jk/maint-ls-files-other:
refactor handling of "other" files in ls-files and status
Diffstat (limited to 'wt-status.c')
-rw-r--r-- | wt-status.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/wt-status.c b/wt-status.c index 889e50f89..64cedfcbe 100644 --- a/wt-status.c +++ b/wt-status.c @@ -275,20 +275,9 @@ static void wt_status_print_untracked(struct wt_status *s) read_directory(&dir, ".", "", 0, NULL); for(i = 0; i < dir.nr; i++) { - /* check for matching entry, which is unmerged; lifted from - * builtin-ls-files:show_other_files */ struct dir_entry *ent = dir.entries[i]; - int pos = cache_name_pos(ent->name, ent->len); - struct cache_entry *ce; - if (0 <= pos) - die("bug in wt_status_print_untracked"); - pos = -pos - 1; - if (pos < active_nr) { - ce = active_cache[pos]; - if (ce_namelen(ce) == ent->len && - !memcmp(ce->name, ent->name, ent->len)) - continue; - } + if (!cache_name_is_other(ent->name, ent->len)) + continue; if (!shown_header) { s->workdir_untracked = 1; wt_status_print_header(s, "Untracked files", |