author | Lars Hjemli <hjemli@gmail.com> | 2008-02-16 12:56:09 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-02-16 12:56:09 (UTC) |
commit | d1f3bbe9d22029f45a77bb938c176ccc0c827d46 (patch) (side-by-side diff) | |
tree | 3f1741c012763cbc5485f31377abdd9241fbac6b /cache.c | |
parent | b228d4ff82a65fdcd4a7364759fe36a0bdda5978 (diff) | |
download | cgit-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.zip cgit-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.tar.gz cgit-d1f3bbe9d22029f45a77bb938c176ccc0c827d46.tar.bz2 |
Move cgit_repo into cgit_context
This removes the global variable which is used to keep track of the
currently selected repository, and adds a new variable in the cgit_context
structure.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cache.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -39,36 +39,36 @@ int cache_exist(struct cacheitem *item) } return 1; } int cache_create_dirs() { char *path; path = fmt("%s", ctx.cfg.cache_root); if (mkdir(path, S_IRWXU) && errno!=EEXIST) return 0; - if (!cgit_repo) + if (!ctx.repo) return 0; path = fmt("%s/%s", ctx.cfg.cache_root, - cache_safe_filename(cgit_repo->url)); + cache_safe_filename(ctx.repo->url)); if (mkdir(path, S_IRWXU) && errno!=EEXIST) return 0; if (ctx.qry.page) { path = fmt("%s/%s/%s", ctx.cfg.cache_root, - cache_safe_filename(cgit_repo->url), + cache_safe_filename(ctx.repo->url), ctx.qry.page); if (mkdir(path, S_IRWXU) && errno!=EEXIST) return 0; } return 1; } int cache_refill_overdue(const char *lockfile) { struct stat st; if (stat(lockfile, &st)) |