|
diff --git a/cgit.c b/cgit.c index 64d95f9..411e421 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -185,48 +185,49 @@ static void prepare_context(struct cgit_context *ctx) |
185 | ctx->cfg.css = "/cgit.css"; |
185 | ctx->cfg.css = "/cgit.css"; |
186 | ctx->cfg.logo = "/git-logo.png"; |
186 | ctx->cfg.logo = "/git-logo.png"; |
187 | ctx->cfg.local_time = 0; |
187 | ctx->cfg.local_time = 0; |
188 | ctx->cfg.max_repo_count = 50; |
188 | ctx->cfg.max_repo_count = 50; |
189 | ctx->cfg.max_commit_count = 50; |
189 | ctx->cfg.max_commit_count = 50; |
190 | ctx->cfg.max_lock_attempts = 5; |
190 | ctx->cfg.max_lock_attempts = 5; |
191 | ctx->cfg.max_msg_len = 80; |
191 | ctx->cfg.max_msg_len = 80; |
192 | ctx->cfg.max_repodesc_len = 80; |
192 | ctx->cfg.max_repodesc_len = 80; |
193 | ctx->cfg.max_stats = 0; |
193 | ctx->cfg.max_stats = 0; |
194 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; |
194 | ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s"; |
195 | ctx->cfg.renamelimit = -1; |
195 | ctx->cfg.renamelimit = -1; |
196 | ctx->cfg.robots = "index, nofollow"; |
196 | ctx->cfg.robots = "index, nofollow"; |
197 | ctx->cfg.root_title = "Git repository browser"; |
197 | ctx->cfg.root_title = "Git repository browser"; |
198 | ctx->cfg.root_desc = "a fast webinterface for the git dscm"; |
198 | ctx->cfg.root_desc = "a fast webinterface for the git dscm"; |
199 | ctx->cfg.script_name = CGIT_SCRIPT_NAME; |
199 | ctx->cfg.script_name = CGIT_SCRIPT_NAME; |
200 | ctx->cfg.summary_branches = 10; |
200 | ctx->cfg.summary_branches = 10; |
201 | ctx->cfg.summary_log = 10; |
201 | ctx->cfg.summary_log = 10; |
202 | ctx->cfg.summary_tags = 10; |
202 | ctx->cfg.summary_tags = 10; |
203 | ctx->page.mimetype = "text/html"; |
203 | ctx->page.mimetype = "text/html"; |
204 | ctx->page.charset = PAGE_ENCODING; |
204 | ctx->page.charset = PAGE_ENCODING; |
205 | ctx->page.filename = NULL; |
205 | ctx->page.filename = NULL; |
206 | ctx->page.size = 0; |
206 | ctx->page.size = 0; |
207 | ctx->page.modified = time(NULL); |
207 | ctx->page.modified = time(NULL); |
208 | ctx->page.expires = ctx->page.modified; |
208 | ctx->page.expires = ctx->page.modified; |
| |
209 | ctx->page.etag = NULL; |
209 | } |
210 | } |
210 | |
211 | |
211 | struct refmatch { |
212 | struct refmatch { |
212 | char *req_ref; |
213 | char *req_ref; |
213 | char *first_ref; |
214 | char *first_ref; |
214 | int match; |
215 | int match; |
215 | }; |
216 | }; |
216 | |
217 | |
217 | int find_current_ref(const char *refname, const unsigned char *sha1, |
218 | int find_current_ref(const char *refname, const unsigned char *sha1, |
218 | int flags, void *cb_data) |
219 | int flags, void *cb_data) |
219 | { |
220 | { |
220 | struct refmatch *info; |
221 | struct refmatch *info; |
221 | |
222 | |
222 | info = (struct refmatch *)cb_data; |
223 | info = (struct refmatch *)cb_data; |
223 | if (!strcmp(refname, info->req_ref)) |
224 | if (!strcmp(refname, info->req_ref)) |
224 | info->match = 1; |
225 | info->match = 1; |
225 | if (!info->first_ref) |
226 | if (!info->first_ref) |
226 | info->first_ref = xstrdup(refname); |
227 | info->first_ref = xstrdup(refname); |
227 | return info->match; |
228 | return info->match; |
228 | } |
229 | } |
229 | |
230 | |
230 | char *find_default_branch(struct cgit_repo *repo) |
231 | char *find_default_branch(struct cgit_repo *repo) |
231 | { |
232 | { |
232 | struct refmatch info; |
233 | struct refmatch info; |
|