mirror of
https://git.zx2c4.com/cgit
synced 2024-11-25 01:48:41 +00:00
0ff143df70
For many commands/pages (e.g. 'tree', 'diff', 'plain', etc.), the ctx.qry.path argument is interpreted as a path within the "virtual" project directory structure. However, for some other commands (notably 'refs', and the clone-related commands) ctx.qry.path is used in a different context (as a more or less "real" path within the '.git' directory). This patch differentiates between these two usages of ctx.qry.path, by introducing a new variable - ctx.qry.vpath - which is equal to ctx.qry.path in the former case, and NULL in the latter. This will become useful in future patches when we want various pages and the links between them to preserve existing in-project paths. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
17 lines
287 B
C
17 lines
287 B
C
#ifndef CMD_H
|
|
#define CMD_H
|
|
|
|
typedef void (*cgit_cmd_fn)(struct cgit_context *ctx);
|
|
|
|
struct cgit_cmd {
|
|
const char *name;
|
|
cgit_cmd_fn fn;
|
|
unsigned int want_repo:1,
|
|
want_layout:1,
|
|
want_vpath:1;
|
|
};
|
|
|
|
extern struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx);
|
|
|
|
#endif /* CMD_H */
|