summaryrefslogtreecommitdiffabout
path: root/cgit.c
Unidiff
Diffstat (limited to 'cgit.c') (more/less context) (show whitespace changes)
-rw-r--r--cgit.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index 7b7afba..fedf355 100644
--- a/cgit.c
+++ b/cgit.c
@@ -79,29 +79,38 @@ static void cgit_print_repo_page(struct cacheitem *item)
79 show_search = 0; 79 show_search = 0;
80 setenv("GIT_DIR", cgit_repo->path, 1); 80 setenv("GIT_DIR", cgit_repo->path, 1);
81 81
82 if (cgit_repo->snapshots && cgit_query_page && 82 if (cgit_repo->snapshots && cgit_query_page &&
83 !strcmp(cgit_query_page, "snapshot")) { 83 !strcmp(cgit_query_page, "snapshot")) {
84 cgit_print_snapshot(item, cgit_query_sha1, "zip", 84 cgit_print_snapshot(item, cgit_query_sha1, "zip",
85 cgit_repo->url, cgit_query_name); 85 cgit_repo->url, cgit_query_name);
86 return; 86 return;
87 } 87 }
88 88
89 if (cgit_query_page && !strcmp(cgit_query_page, "log")) 89 if (cgit_query_page && !strcmp(cgit_query_page, "log"))
90 show_search = 1; 90 show_search = 1;
91
91 cgit_print_docstart(title, item); 92 cgit_print_docstart(title, item);
92 cgit_print_pageheader(title, show_search); 93
94
93 if (!cgit_query_page) { 95 if (!cgit_query_page) {
96 cgit_print_pageheader("summary", show_search);
94 cgit_print_summary(); 97 cgit_print_summary();
95 } else if (!strcmp(cgit_query_page, "log")) { 98 cgit_print_docend();
99 return;
100 }
101
102 cgit_print_pageheader(cgit_query_page, show_search);
103
104 if (!strcmp(cgit_query_page, "log")) {
96 cgit_print_log(cgit_query_head, cgit_query_ofs, 100, 105 cgit_print_log(cgit_query_head, cgit_query_ofs, 100,
97 cgit_query_search); 106 cgit_query_search);
98 } else if (!strcmp(cgit_query_page, "tree")) { 107 } else if (!strcmp(cgit_query_page, "tree")) {
99 cgit_print_tree(cgit_query_sha1, cgit_query_path); 108 cgit_print_tree(cgit_query_sha1, cgit_query_path);
100 } else if (!strcmp(cgit_query_page, "commit")) { 109 } else if (!strcmp(cgit_query_page, "commit")) {
101 cgit_print_commit(cgit_query_sha1); 110 cgit_print_commit(cgit_query_sha1);
102 } else if (!strcmp(cgit_query_page, "view")) { 111 } else if (!strcmp(cgit_query_page, "view")) {
103 cgit_print_view(cgit_query_sha1); 112 cgit_print_view(cgit_query_sha1);
104 } else if (!strcmp(cgit_query_page, "diff")) { 113 } else if (!strcmp(cgit_query_page, "diff")) {
105 cgit_print_diff(cgit_query_sha1, cgit_query_sha2); 114 cgit_print_diff(cgit_query_sha1, cgit_query_sha2);
106 } else { 115 } else {
107 cgit_print_error("Invalid request"); 116 cgit_print_error("Invalid request");