+
+ strbuf_add(&pathbuf, path, strlen(path));
+ if (is_git_dir(pathbuf.buf)) {
+ add_repo(base, &pathbuf, fn);
+ goto end;
+ }
+ strbuf_addstr(&pathbuf, "/.git");
+ if (is_git_dir(pathbuf.buf)) {
+ add_repo(base, &pathbuf, fn);
+ goto end;
+ }
+ /*
+ * Add one because we don't want to lose the trailing '/' when we
+ * reset the length of pathbuf in the loop below.
+ */
+ pathlen++;
+ while ((ent = readdir(dir)) != NULL) {