X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=ls-files.c;h=df25c8c012a96a8277413ca3a81490b81b7dc067;hb=5241bfe6d1593ad775dd79a5f598f66f479968b5;hp=52bbfdc805aecaa9c463adbb4ef94d1af9c8511f;hpb=29cd1fa451a6e037deb31db9307ed09d6d4262c9;p=git.git diff --git a/ls-files.c b/ls-files.c index 52bbfdc8..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; @@ -777,7 +780,8 @@ int main(int argc, const char **argv) if (ps_matched[num]) continue; error("pathspec '%s' did not match any.", - pathspec[num] + prefix_len); + pathspec[num] + prefix_offset); + errors++; } return errors ? 1 : 0; }