MCPcopy Create free account
hub / github.com/git/git / count_files

Function count_files

diagnose.c:74–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74static 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
91static void loose_objs_stats(struct strbuf *buf, const char *path)
92{

Callers 1

loose_objs_statsFunction · 0.85

Calls 4

opendirFunction · 0.85
get_dtypeFunction · 0.85
closedirFunction · 0.85

Tested by

no test coverage detected