]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-ls-files.c
gitignore(5): Allow "foo/" in ignore list to match directory "foo"
[git.git] / builtin-ls-files.c
index 0f0ab2da167c57402efad9dc09e58964759c23cd..dbba371b8e37dc73e4e07f9df703698af9fa0933 100644 (file)
@@ -238,7 +238,8 @@ static void show_files(struct dir_struct *dir, const char *prefix)
        if (show_cached | show_stage) {
                for (i = 0; i < active_nr; i++) {
                        struct cache_entry *ce = active_cache[i];
-                       if (excluded(dir, ce->name) != dir->show_ignored)
+                       if (excluded(dir, ce->name, ce_to_dtype(ce)) !=
+                           dir->show_ignored)
                                continue;
                        if (show_unmerged && !ce_stage(ce))
                                continue;
@@ -252,7 +253,8 @@ static void show_files(struct dir_struct *dir, const char *prefix)
                        struct cache_entry *ce = active_cache[i];
                        struct stat st;
                        int err;
-                       if (excluded(dir, ce->name) != dir->show_ignored)
+                       if (excluded(dir, ce->name, ce_to_dtype(ce)) !=
+                           dir->show_ignored)
                                continue;
                        err = lstat(ce->name, &st);
                        if (show_deleted && err)