| 72 | } |
| 73 | |
| 74 | static int count_files(struct strbuf *path) |
| 75 | { |
| 76 | DIR *dir = opendir(path->buf); |
| 77 | struct dirent *e; |
| 78 | int count = 0; |
| 79 | |
| 80 | if (!dir) |
| 81 | return 0; |
| 82 | |
| 83 | while ((e = readdir_skip_dot_and_dotdot(dir)) != NULL) |
| 84 | if (get_dtype(e, path, 0) == DT_REG) |
| 85 | count++; |
| 86 | |
| 87 | closedir(dir); |
| 88 | return count; |
| 89 | } |
| 90 | |
| 91 | static void loose_objs_stats(struct strbuf *buf, const char *path) |
| 92 | { |
no test coverage detected