- setenv("GIT_DIR", fmt("%s/%s", cgit_root, cgit_query_repo), 1);
- char *title = fmt("%s - %s", cgit_repo_name, cgit_repo_desc);
- int show_search = 0;
+
+ title = fmt("%s - %s", cgit_repo->name, cgit_repo->desc);
+ show_search = 0;
+ setenv("GIT_DIR", cgit_repo->path, 1);
+
+ if (cgit_query_page) {
+ if (cgit_repo->snapshots && !strcmp(cgit_query_page, "snapshot")) {
+ cgit_print_snapshot(item, cgit_query_sha1, "zip",
+ cgit_repo->url, cgit_query_name);
+ return;
+ }
+ if (!strcmp(cgit_query_page, "blob")) {
+ cgit_print_blob(item, cgit_query_sha1, cgit_query_path);
+ return;
+ }
+ }
+