X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=ls-files.c;h=df25c8c012a96a8277413ca3a81490b81b7dc067;hb=beb8e1343745e99988b84b05d257ef3171f127be;hp=c533059d0a0cf5969b6d7309ed7840e935eebfe0;hpb=0d27c3f699eb4d9268449a867901c8cc5f36efd6;p=git.git diff --git a/ls-files.c b/ls-files.c index c533059d..df25c8c0 100644 --- a/ls-files.c +++ b/ls-files.c @@ -279,8 +279,11 @@ static void read_directory(const char *path, const char *base, int baselen) continue; len = strlen(de->d_name); memcpy(fullname + baselen, de->d_name, len+1); - if (excluded(fullname) != show_ignored) - continue; + if (excluded(fullname) != show_ignored) { + if (!show_ignored || DTYPE(de) != DT_DIR) { + continue; + } + } switch (DTYPE(de)) { struct stat st; @@ -778,6 +781,7 @@ int main(int argc, const char **argv) continue; error("pathspec '%s' did not match any.", pathspec[num] + prefix_offset); + errors++; } return errors ? 1 : 0; }