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>
此提交包含在:
6
cache.c
6
cache.c
@ -48,18 +48,18 @@ int cache_create_dirs()
|
||||
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;
|
||||
|
新增問題並參考
封鎖使用者