X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-count-objects.c;h=b814fe5070873f5c87fc6bbfde480e3b0a83e397;hb=ef52aafa0f8b1d34f2ecd9b58f2198711c87cab3;hp=ab35b65b073e9bc089fcc96f295ca3bc457c992a;hpb=aa41cf8f43687579363a2360795cac621d5254ed;p=git.git diff --git a/builtin-count-objects.c b/builtin-count-objects.c index ab35b65b0..b814fe507 100644 --- a/builtin-count-objects.c +++ b/builtin-count-objects.c @@ -5,6 +5,7 @@ */ #include "cache.h" +#include "dir.h" #include "builtin.h" #include "parse-options.h" @@ -21,9 +22,7 @@ static void count_objects(DIR *d, char *path, int len, int verbose, const char *cp; int bad = 0; - if ((ent->d_name[0] == '.') && - (ent->d_name[1] == 0 || - ((ent->d_name[1] == '.') && (ent->d_name[2] == 0)))) + if (is_dot_or_dotdot(ent->d_name)) continue; for (cp = ent->d_name; *cp; cp++) { int ch = *cp; @@ -61,7 +60,7 @@ static void count_objects(DIR *d, char *path, int len, int verbose, hex[40] = 0; if (get_sha1_hex(hex, sha1)) die("internal error"); - if (has_sha1_pack(sha1, NULL)) + if (has_sha1_pack(sha1)) (*packed_loose)++; } }