- title = fmt("%s - %s", cgit_repo->name, cgit_repo->desc);
- show_search = 0;
- setenv("GIT_DIR", cgit_repo->path, 1);
+ 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_repobasename(ctx.repo->url),
+ ctx.qry.path,
+ ctx.repo->snapshots );
+ return;
+ }