]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/maint-1.6.3-ls-files-no-ignore-cached' into maint-1.6.4
authorJunio C Hamano <gitster@pobox.com>
Sun, 25 Oct 2009 22:34:27 +0000 (15:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 25 Oct 2009 22:34:27 +0000 (15:34 -0700)
* jk/maint-1.6.3-ls-files-no-ignore-cached:
  ls-files: excludes should not impact tracked files

1  2 
builtin-ls-files.c

diff --combined builtin-ls-files.c
index 2c95ca61056f0c0b6ac0240605e2e4de895a6804,16a1370647fc69da357d7af9b195bb19a99c2123..c5c0407b0b824327b0bbc6ae50ae1a030761b2b9
@@@ -161,7 -161,12 +161,7 @@@ static void show_files(struct dir_struc
  
        /* For cached/deleted files we don't need to even do the readdir */
        if (show_others || show_killed) {
 -              const char *path = ".", *base = "";
 -              int baselen = prefix_len;
 -
 -              if (baselen)
 -                      path = base = prefix;
 -              read_directory(dir, path, base, baselen, pathspec);
 +              fill_directory(dir, pathspec);
                if (show_others)
                        show_other_files(dir);
                if (show_killed)
        if (show_cached | show_stage) {
                for (i = 0; i < active_nr; i++) {
                        struct cache_entry *ce = active_cache[i];
-                       int dtype = ce_to_dtype(ce);
-                       if (excluded(dir, ce->name, &dtype) !=
-                                       !!(dir->flags & DIR_SHOW_IGNORED))
-                               continue;
                        if (show_unmerged && !ce_stage(ce))
                                continue;
                        if (ce->ce_flags & CE_UPDATE)
                        struct cache_entry *ce = active_cache[i];
                        struct stat st;
                        int err;
-                       int dtype = ce_to_dtype(ce);
-                       if (excluded(dir, ce->name, &dtype) !=
-                                       !!(dir->flags & DIR_SHOW_IGNORED))
-                               continue;
                        if (ce->ce_flags & CE_UPDATE)
                                continue;
                        err = lstat(ce->name, &st);
@@@ -449,7 -446,7 +441,7 @@@ int cmd_ls_files(int argc, const char *
                OPT_BIT(0, "directory", &dir.flags,
                        "show 'other' directories' name only",
                        DIR_SHOW_OTHER_DIRECTORIES),
 -              OPT_BIT(0, "no-empty-directory", &dir.flags,
 +              OPT_NEGBIT(0, "empty-directory", &dir.flags,
                        "don't show empty directories",
                        DIR_HIDE_EMPTY_DIRECTORIES),
                OPT_BOOLEAN('u', "unmerged", &show_unmerged,
                prefix_offset = strlen(prefix);
        git_config(git_default_config, NULL);
  
 -      argc = parse_options(argc, argv, builtin_ls_files_options,
 +      argc = parse_options(argc, argv, prefix, builtin_ls_files_options,
                        ls_files_usage, 0);
        if (show_tag || show_valid_bit) {
                tag_cached = "H ";
                ps_matched = xcalloc(1, num);
        }
  
 -      if ((dir.flags & DIR_SHOW_IGNORED) && !exc_given) {
 -              fprintf(stderr, "%s: --ignored needs some exclude pattern\n",
 -                      argv[0]);
 -              exit(1);
 -      }
 +      if ((dir.flags & DIR_SHOW_IGNORED) && !exc_given)
 +              die("ls-files --ignored needs some exclude pattern");
  
        /* With no flags, we default to showing the cached files */
        if (!(show_stage | show_deleted | show_others | show_unmerged |