git-compat-util: add xstrdup_or_null helper
[gitweb.git] / builtin / ls-files.c
index 02db0e1ae82fb4fb675d940df3cd68c19c817b50..99cee20fb07ce7ed03da230bfa031c277f584fc1 100644 (file)
@@ -140,7 +140,8 @@ static void show_ce_entry(const char *tag, const struct cache_entry *ce)
                die("git ls-files: internal error - cache entry not superset of prefix");
 
        if (!match_pathspec(&pathspec, ce->name, ce_namelen(ce),
-                           len, ps_matched))
+                           len, ps_matched,
+                           S_ISDIR(ce->ce_mode) || S_ISGITLINK(ce->ce_mode)))
                return;
 
        if (tag && *tag && show_valid_bit &&
@@ -197,7 +198,7 @@ static void show_ru_info(void)
                if (len < max_prefix_len)
                        continue; /* outside of the prefix */
                if (!match_pathspec(&pathspec, path, len,
-                                   max_prefix_len, ps_matched))
+                                   max_prefix_len, ps_matched, 0))
                        continue; /* uninterested */
                for (i = 0; i < 3; i++) {
                        if (!ui->mode[i])
@@ -473,7 +474,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
                OPT_BOOL('k', "killed", &show_killed,
                        N_("show files on the filesystem that need to be removed")),
                OPT_BIT(0, "directory", &dir.flags,
-                       N_("show 'other' directories' name only"),
+                       N_("show 'other' directories' names only"),
                        DIR_SHOW_OTHER_DIRECTORIES),
                OPT_NEGBIT(0, "empty-directory", &dir.flags,
                        N_("don't show empty directories"),