author | Lars Hjemli <hjemli@gmail.com> | 2008-03-25 01:00:09 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-03-25 01:00:09 (UTC) |
commit | dc3282f0baa14949439593729a45fbe143e3622c (patch) (unidiff) | |
tree | 2eb7eabeb11c4a1c1e132d396ac5c621caf48414 /cgit.c | |
parent | c60781d677ee3b2e53b1f3078fef763622e5effe (diff) | |
download | cgit-dc3282f0baa14949439593729a45fbe143e3622c.zip cgit-dc3282f0baa14949439593729a45fbe143e3622c.tar.gz cgit-dc3282f0baa14949439593729a45fbe143e3622c.tar.bz2 |
Remove global and obsolete cgit_cmd
This variable was obsoleted by cmd.c.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -160,49 +160,49 @@ static void prepare_context(struct cgit_context *ctx) | |||
160 | ctx->page.mimetype = "text/html"; | 160 | ctx->page.mimetype = "text/html"; |
161 | ctx->page.charset = PAGE_ENCODING; | 161 | ctx->page.charset = PAGE_ENCODING; |
162 | ctx->page.filename = NULL; | 162 | ctx->page.filename = NULL; |
163 | } | 163 | } |
164 | 164 | ||
165 | static int cgit_prepare_cache(struct cacheitem *item) | 165 | static int cgit_prepare_cache(struct cacheitem *item) |
166 | { | 166 | { |
167 | if (!ctx.repo && ctx.qry.repo) { | 167 | if (!ctx.repo && ctx.qry.repo) { |
168 | ctx.page.title = fmt("%s - %s", ctx.cfg.root_title, | 168 | ctx.page.title = fmt("%s - %s", ctx.cfg.root_title, |
169 | "Bad request"); | 169 | "Bad request"); |
170 | cgit_print_http_headers(&ctx); | 170 | cgit_print_http_headers(&ctx); |
171 | cgit_print_docstart(&ctx); | 171 | cgit_print_docstart(&ctx); |
172 | cgit_print_pageheader(&ctx); | 172 | cgit_print_pageheader(&ctx); |
173 | cgit_print_error(fmt("Unknown repo: %s", ctx.qry.repo)); | 173 | cgit_print_error(fmt("Unknown repo: %s", ctx.qry.repo)); |
174 | cgit_print_docend(); | 174 | cgit_print_docend(); |
175 | return 0; | 175 | return 0; |
176 | } | 176 | } |
177 | 177 | ||
178 | if (!ctx.repo) { | 178 | if (!ctx.repo) { |
179 | item->name = xstrdup(fmt("%s/index.html", ctx.cfg.cache_root)); | 179 | item->name = xstrdup(fmt("%s/index.html", ctx.cfg.cache_root)); |
180 | item->ttl = ctx.cfg.cache_root_ttl; | 180 | item->ttl = ctx.cfg.cache_root_ttl; |
181 | return 1; | 181 | return 1; |
182 | } | 182 | } |
183 | 183 | ||
184 | if (!cgit_cmd) { | 184 | if (!ctx.qry.page) { |
185 | item->name = xstrdup(fmt("%s/%s/index.%s.html", ctx.cfg.cache_root, | 185 | item->name = xstrdup(fmt("%s/%s/index.%s.html", ctx.cfg.cache_root, |
186 | cache_safe_filename(ctx.repo->url), | 186 | cache_safe_filename(ctx.repo->url), |
187 | cache_safe_filename(ctx.qry.raw))); | 187 | cache_safe_filename(ctx.qry.raw))); |
188 | item->ttl = ctx.cfg.cache_repo_ttl; | 188 | item->ttl = ctx.cfg.cache_repo_ttl; |
189 | } else { | 189 | } else { |
190 | item->name = xstrdup(fmt("%s/%s/%s/%s.html", ctx.cfg.cache_root, | 190 | item->name = xstrdup(fmt("%s/%s/%s/%s.html", ctx.cfg.cache_root, |
191 | cache_safe_filename(ctx.repo->url), | 191 | cache_safe_filename(ctx.repo->url), |
192 | ctx.qry.page, | 192 | ctx.qry.page, |
193 | cache_safe_filename(ctx.qry.raw))); | 193 | cache_safe_filename(ctx.qry.raw))); |
194 | if (ctx.qry.has_symref) | 194 | if (ctx.qry.has_symref) |
195 | item->ttl = ctx.cfg.cache_dynamic_ttl; | 195 | item->ttl = ctx.cfg.cache_dynamic_ttl; |
196 | else if (ctx.qry.has_sha1) | 196 | else if (ctx.qry.has_sha1) |
197 | item->ttl = ctx.cfg.cache_static_ttl; | 197 | item->ttl = ctx.cfg.cache_static_ttl; |
198 | else | 198 | else |
199 | item->ttl = ctx.cfg.cache_repo_ttl; | 199 | item->ttl = ctx.cfg.cache_repo_ttl; |
200 | } | 200 | } |
201 | return 1; | 201 | return 1; |
202 | } | 202 | } |
203 | 203 | ||
204 | struct refmatch { | 204 | struct refmatch { |
205 | char *req_ref; | 205 | char *req_ref; |
206 | char *first_ref; | 206 | char *first_ref; |
207 | int match; | 207 | int match; |
208 | }; | 208 | }; |