-rw-r--r-- | cgit.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -68,33 +68,33 @@ int find_current_ref(const char *refname, const unsigned char *sha1, } 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); ctx.repo = NULL; cgit_print_http_headers(&ctx); cgit_print_docstart(&ctx); cgit_print_pageheader(&ctx); @@ -119,46 +119,46 @@ static void cgit_print_repo_page(struct cacheitem *item) cgit_print_docend(); return; } 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; } cgit_print_pageheader(&ctx); switch(cgit_cmd) { @@ -197,35 +197,35 @@ static long ttl_seconds(long ttl) } 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; top: if (++i > ctx.cfg.max_lock_attempts) { die("cgit_refresh_cache: unable to lock %s: %s", |