- if (!strcmp(rel + strlen(rel) - 5, "/.git"))
- rel[strlen(rel) - 5] = '\0';
+ if (!strcmp(rel.buf + rel.len - 5, "/.git"))
+ strbuf_setlen(&rel, rel.len - 5);
+ else if (rel.len && rel.buf[rel.len - 1] == '/')
+ strbuf_setlen(&rel, rel.len - 1);
+
+ repo = cgit_add_repo(rel.buf);
+ config_fn = fn;
+ if (ctx.cfg.enable_git_config) {
+ strbuf_addstr(path, "config");
+ git_config_from_file(gitconfig_config, path->buf, NULL);
+ strbuf_setlen(path, pathlen);
+ }