removed http_headers if repos are not present

master
KatolaZ 6 years ago
parent 7fd094820d
commit 8185a40185
  1. 12
      cgit-70.c

@ -587,12 +587,14 @@ static int prepare_repo_cmd(int nongit)
ctx.page.title = fmtalloc("%s - %s", ctx.cfg.root_title, ctx.page.title = fmtalloc("%s - %s", ctx.cfg.root_title,
"config error"); "config error");
ctx.repo = NULL; ctx.repo = NULL;
cgit_print_http_headers(); /* cgit_print_http_headers();
cgit_print_docstart(); cgit_print_docstart();
cgit_print_pageheader(); cgit_print_pageheader();
cgit_print_error("Failed to open %s: %s", name, cgit_print_error("Failed to open %s: %s", name,
rc ? strerror(rc) : "Not a valid git repository"); rc ? strerror(rc) : "Not a valid git repository");
cgit_print_docend(); cgit_print_docend();*/
ctx.page.title = "cgit error";
cgit_gopher_error("Config error -- Invalid repository");
return 1; return 1;
} }
ctx.page.title = fmtalloc("%s - %s", ctx.repo->name, ctx.repo->desc); ctx.page.title = fmtalloc("%s - %s", ctx.repo->name, ctx.repo->desc);
@ -606,7 +608,7 @@ static int prepare_repo_cmd(int nongit)
} }
if (!ctx.qry.head) { if (!ctx.qry.head) {
cgit_print_http_headers(); /* cgit_print_http_headers();
cgit_print_docstart(); cgit_print_docstart();
cgit_print_pageheader(); cgit_print_pageheader();
cgit_print_error("Repository seems to be empty"); cgit_print_error("Repository seems to be empty");
@ -616,7 +618,9 @@ static int prepare_repo_cmd(int nongit)
cgit_add_clone_urls(print_no_repo_clone_urls); cgit_add_clone_urls(print_no_repo_clone_urls);
html("</table>\n"); html("</table>\n");
} }
cgit_print_docend(); cgit_print_docend();*/
ctx.page.title = "cgit error";
cgit_gopher_error("Repository seems to be empty");
return 1; return 1;
} }

Loading…
Cancel
Save