X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=ls-files.c;h=df25c8c012a96a8277413ca3a81490b81b7dc067;hb=5ceb05f82edc49ad5e6b0ad98d633c124a567309;hp=c533059d0a0cf5969b6d7309ed7840e935eebfe0;hpb=0f4aa3993de5fc7252e43ebd872fd9e4b615873d;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; }