summaryrefslogtreecommitdiffabout
path: root/cgit.c
Side-by-side diff
Diffstat (limited to 'cgit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cgit.c b/cgit.c
index d0f6905..a83f0be 100644
--- a/cgit.c
+++ b/cgit.c
@@ -72,25 +72,25 @@ char *find_default_branch(struct cgit_repo *repo)
struct refmatch info;
info.req_ref = repo->defbranch;
info.first_ref = NULL;
info.match = 0;
for_each_branch_ref(find_current_ref, &info);
if (info.match)
return info.req_ref;
else
return info.first_ref;
}
-static void cgit_print_repo_page(struct cacheitem *item)
+static void cgit_print_repo_page()
{
char *tmp;
int show_search;
unsigned char sha1[20];
int nongit = 0;
setenv("GIT_DIR", ctx.repo->path, 1);
setup_git_directory_gently(&nongit);
if (nongit) {
ctx.page.title = fmt("%s - %s", ctx.cfg.root_title,
"config error");
tmp = fmt("Not a git repository: '%s'", ctx.repo->path);
@@ -123,38 +123,38 @@ static void cgit_print_repo_page(struct cacheitem *item)
if (get_sha1(ctx.qry.head, sha1)) {
tmp = xstrdup(ctx.qry.head);
ctx.qry.head = ctx.repo->defbranch;
cgit_print_http_headers(&ctx);
cgit_print_docstart(&ctx);
cgit_print_pageheader(&ctx);
cgit_print_error(fmt("Invalid branch: %s", tmp));
cgit_print_docend();
return;
}
if ((cgit_cmd == CMD_SNAPSHOT) && ctx.repo->snapshots) {
- cgit_print_snapshot(item, ctx.qry.head, ctx.qry.sha1,
+ cgit_print_snapshot(ctx.qry.head, ctx.qry.sha1,
cgit_repobasename(ctx.repo->url),
ctx.qry.path,
ctx.repo->snapshots );
return;
}
if (cgit_cmd == CMD_PATCH) {
- cgit_print_patch(ctx.qry.sha1, item);
+ cgit_print_patch(ctx.qry.sha1);
return;
}
if (cgit_cmd == CMD_BLOB) {
- cgit_print_blob(item, ctx.qry.sha1, ctx.qry.path);
+ cgit_print_blob(ctx.qry.sha1, ctx.qry.path);
return;
}
show_search = (cgit_cmd == CMD_LOG);
cgit_print_http_headers(&ctx);
cgit_print_docstart(&ctx);
if (!cgit_cmd) {
cgit_print_pageheader(&ctx);
cgit_print_summary();
cgit_print_docend();
return;
}
@@ -201,27 +201,27 @@ static void cgit_fill_cache(struct cacheitem *item, int use_cache)
int stdout2;
if (use_cache) {
stdout2 = chk_positive(dup(STDOUT_FILENO),
"Preserving STDOUT");
chk_zero(close(STDOUT_FILENO), "Closing STDOUT");
chk_positive(dup2(item->fd, STDOUT_FILENO), "Dup2(cachefile)");
}
ctx.page.modified = time(NULL);
ctx.page.expires = ctx.page.modified + ttl_seconds(item->ttl);
if (ctx.repo)
- cgit_print_repo_page(item);
+ cgit_print_repo_page();
else
- cgit_print_repolist(item);
+ cgit_print_repolist();
if (use_cache) {
chk_zero(close(STDOUT_FILENO), "Close redirected STDOUT");
chk_positive(dup2(stdout2, STDOUT_FILENO),
"Restoring original STDOUT");
chk_zero(close(stdout2), "Closing temporary STDOUT");
}
}
static void cgit_check_cache(struct cacheitem *item)
{
int i = 0;