|
diff --git a/cgit.c b/cgit.c index fedf355..6dddcbb 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -88,49 +88,49 @@ static void cgit_print_repo_page(struct cacheitem *item) |
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 | |
92 | cgit_print_docstart(title, item); |
92 | cgit_print_docstart(title, item); |
93 | |
93 | |
94 | |
94 | |
95 | if (!cgit_query_page) { |
95 | if (!cgit_query_page) { |
96 | cgit_print_pageheader("summary", show_search); |
96 | cgit_print_pageheader("summary", show_search); |
97 | cgit_print_summary(); |
97 | cgit_print_summary(); |
98 | cgit_print_docend(); |
98 | cgit_print_docend(); |
99 | return; |
99 | return; |
100 | } |
100 | } |
101 | |
101 | |
102 | cgit_print_pageheader(cgit_query_page, show_search); |
102 | cgit_print_pageheader(cgit_query_page, show_search); |
103 | |
103 | |
104 | if (!strcmp(cgit_query_page, "log")) { |
104 | if (!strcmp(cgit_query_page, "log")) { |
105 | cgit_print_log(cgit_query_head, cgit_query_ofs, 100, |
105 | cgit_print_log(cgit_query_head, cgit_query_ofs, 100, |
106 | cgit_query_search); |
106 | cgit_query_search); |
107 | } else if (!strcmp(cgit_query_page, "tree")) { |
107 | } else if (!strcmp(cgit_query_page, "tree")) { |
108 | cgit_print_tree(cgit_query_sha1, cgit_query_path); |
108 | cgit_print_tree(cgit_query_sha1, cgit_query_path); |
109 | } else if (!strcmp(cgit_query_page, "commit")) { |
109 | } else if (!strcmp(cgit_query_page, "commit")) { |
110 | cgit_print_commit(cgit_query_sha1); |
110 | cgit_print_commit(cgit_query_sha1); |
111 | } else if (!strcmp(cgit_query_page, "view")) { |
111 | } else if (!strcmp(cgit_query_page, "view")) { |
112 | cgit_print_view(cgit_query_sha1); |
112 | cgit_print_view(cgit_query_sha1, cgit_query_path); |
113 | } else if (!strcmp(cgit_query_page, "diff")) { |
113 | } else if (!strcmp(cgit_query_page, "diff")) { |
114 | cgit_print_diff(cgit_query_sha1, cgit_query_sha2); |
114 | cgit_print_diff(cgit_query_sha1, cgit_query_sha2); |
115 | } else { |
115 | } else { |
116 | cgit_print_error("Invalid request"); |
116 | cgit_print_error("Invalid request"); |
117 | } |
117 | } |
118 | cgit_print_docend(); |
118 | cgit_print_docend(); |
119 | } |
119 | } |
120 | |
120 | |
121 | static void cgit_fill_cache(struct cacheitem *item, int use_cache) |
121 | static void cgit_fill_cache(struct cacheitem *item, int use_cache) |
122 | { |
122 | { |
123 | static char buf[PATH_MAX]; |
123 | static char buf[PATH_MAX]; |
124 | int stdout2; |
124 | int stdout2; |
125 | |
125 | |
126 | getcwd(buf, sizeof(buf)); |
126 | getcwd(buf, sizeof(buf)); |
127 | item->st.st_mtime = time(NULL); |
127 | item->st.st_mtime = time(NULL); |
128 | |
128 | |
129 | if (use_cache) { |
129 | if (use_cache) { |
130 | stdout2 = chk_positive(dup(STDOUT_FILENO), |
130 | stdout2 = chk_positive(dup(STDOUT_FILENO), |
131 | "Preserving STDOUT"); |
131 | "Preserving STDOUT"); |
132 | chk_zero(close(STDOUT_FILENO), "Closing STDOUT"); |
132 | chk_zero(close(STDOUT_FILENO), "Closing STDOUT"); |
133 | chk_positive(dup2(item->fd, STDOUT_FILENO), "Dup2(cachefile)"); |
133 | chk_positive(dup2(item->fd, STDOUT_FILENO), "Dup2(cachefile)"); |
134 | } |
134 | } |
135 | |
135 | |
136 | if (cgit_query_repo) |
136 | if (cgit_query_repo) |
|