diff options
| author | Junio C Hamano <gitster@pobox.com> | 2008-10-17 13:03:52 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2008-10-17 13:03:52 -0700 |
| commit | e845e16ee6de99a203db47eeb840daf3b1914ec9 (patch) | |
| tree | 6881244e543cbf5b17cb31a8b8512fa758a608b5 /builtin-ls-files.c | |
| parent | 46dc1b0e332612aa32c139007fa33f4b429de9d1 (diff) | |
| parent | 98fa473887d0bebd38d568bb07232a336a642dcf (diff) | |
| download | git-e845e16ee6de99a203db47eeb840daf3b1914ec9.tar.gz | |
Merge branch 'jk/maint-ls-files-other' into jk/fix-ls-files-other
* jk/maint-ls-files-other:
refactor handling of "other" files in ls-files and status
Conflicts:
read-cache.c
Diffstat (limited to 'builtin-ls-files.c')
| -rw-r--r-- | builtin-ls-files.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 068f424696..b48327db95 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -91,39 +91,10 @@ static void show_other_files(struct dir_struct *dir) { int i; - - /* - * Skip matching and unmerged entries for the paths, - * since we want just "others". - * - * (Matching entries are normally pruned during - * the directory tree walk, but will show up for - * gitlinks because we don't necessarily have - * dir->show_other_directories set to suppress - * them). - */ for (i = 0; i < dir->nr; i++) { struct dir_entry *ent = dir->entries[i]; - int len, pos; - struct cache_entry *ce; - - /* - * Remove the '/' at the end that directory - * walking adds for directory entries. - */ - len = ent->len; - if (len && ent->name[len-1] == '/') - len--; - pos = cache_name_pos(ent->name, len); - if (0 <= pos) - continue; /* exact match */ - pos = -pos - 1; - if (pos < active_nr) { - ce = active_cache[pos]; - if (ce_namelen(ce) == len && - !memcmp(ce->name, ent->name, len)) - continue; /* Yup, this one exists unmerged */ - } + if (!cache_name_is_other(ent->name, ent->len)) + continue; show_dir_entry(tag_other, ent); } } |
