ctx.cfg.enable_http_clone = atoi(value);
else if (!strcmp(name, "enable-index-links"))
ctx.cfg.enable_index_links = atoi(value);
+ else if (!strcmp(name, "enable-index-owner"))
+ ctx.cfg.enable_index_owner = atoi(value);
else if (!strcmp(name, "enable-commit-graph"))
ctx.cfg.enable_commit_graph = atoi(value);
else if (!strcmp(name, "enable-log-filecount"))
ctx.qry.name = xstrdup(value);
} else if (!strcmp(name, "mimetype")) {
ctx.qry.mimetype = xstrdup(value);
- } else if (!strcmp(name, "s")){
+ } else if (!strcmp(name, "s")) {
ctx.qry.sort = xstrdup(value);
} else if (!strcmp(name, "showmsg")) {
ctx.qry.showmsg = atoi(value);
ctx->cfg.logo = "/cgit.png";
ctx->cfg.local_time = 0;
ctx->cfg.enable_http_clone = 1;
+ ctx->cfg.enable_index_owner = 1;
ctx->cfg.enable_tree_linenumbers = 1;
ctx->cfg.enable_git_config = 0;
ctx->cfg.max_repo_count = 50;
const char *ref;
unsigned char sha1[20];
- ref = resolve_ref("HEAD", sha1, 0, NULL);
+ ref = resolve_ref_unsafe("HEAD", sha1, 0, NULL);
if (!ref || prefixcmp(ref, "refs/heads/"))
return "master";
return xstrdup(ref + 11);
{
int i;
- for(i = start; i < list->count; i++)
+ for (i = start; i < list->count; i++)
print_repo(f, &list->repos[i]);
}
for (i = 1; i < argc; i++) {
if (!strncmp(argv[i], "--cache=", 8)) {
- ctx.cfg.cache_root = xstrdup(argv[i]+8);
+ ctx.cfg.cache_root = xstrdup(argv[i] + 8);
}
if (!strcmp(argv[i], "--nocache")) {
ctx.cfg.nocache = 1;
ctx.env.no_http = "1";
}
if (!strncmp(argv[i], "--query=", 8)) {
- ctx.qry.raw = xstrdup(argv[i]+8);
+ ctx.qry.raw = xstrdup(argv[i] + 8);
}
if (!strncmp(argv[i], "--repo=", 7)) {
- ctx.qry.repo = xstrdup(argv[i]+7);
+ ctx.qry.repo = xstrdup(argv[i] + 7);
}
if (!strncmp(argv[i], "--page=", 7)) {
- ctx.qry.page = xstrdup(argv[i]+7);
+ ctx.qry.page = xstrdup(argv[i] + 7);
}
if (!strncmp(argv[i], "--head=", 7)) {
- ctx.qry.head = xstrdup(argv[i]+7);
+ ctx.qry.head = xstrdup(argv[i] + 7);
ctx.qry.has_symref = 1;
}
if (!strncmp(argv[i], "--sha1=", 7)) {
- ctx.qry.sha1 = xstrdup(argv[i]+7);
+ ctx.qry.sha1 = xstrdup(argv[i] + 7);
ctx.qry.has_sha1 = 1;
}
if (!strncmp(argv[i], "--ofs=", 6)) {
- ctx.qry.ofs = atoi(argv[i]+6);
+ ctx.qry.ofs = atoi(argv[i] + 6);
}
if (!strncmp(argv[i], "--scan-tree=", 12) ||
!strncmp(argv[i], "--scan-path=", 12)) {
ctx.cfg.virtual_root = trim_end(ctx.cfg.script_name, '/');
if (!ctx.cfg.virtual_root)
ctx.cfg.virtual_root = "";
- }
+ }
/* If no url parameter is specified on the querystring, lets
* use PATH_INFO as url. This allows cgit to work with virtual
}
ttl = calc_ttl();
- ctx.page.expires += ttl*60;
+ ctx.page.expires += ttl * 60;
if (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD"))
ctx.cfg.nocache = 1;
if (ctx.cfg.nocache)