diff options
author | Johan Herland | 2010-06-10 01:09:26 +0200 |
---|---|---|
committer | Lars Hjemli | 2010-06-19 10:40:22 +0200 |
commit | 0ff143df7043b7dd87c31c50fa875bc96d1a7779 (patch) | |
tree | d1625ba2aafed1ddfebc429921abdbb0d692042f /cmd.h | |
parent | 0e34c6d1ef32ea8f69019272fe72dbf2aeaba392 (diff) | |
download | cgit-0ff143df7043b7dd87c31c50fa875bc96d1a7779.tar.gz cgit-0ff143df7043b7dd87c31c50fa875bc96d1a7779.tar.bz2 cgit-0ff143df7043b7dd87c31c50fa875bc96d1a7779.zip |
struct cgit_cmd: Differentiate between various usages of ctx.qry.path
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>
Diffstat (limited to 'cmd.h')
-rw-r--r-- | cmd.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -7,7 +7,8 @@ struct cgit_cmd { | |||
7 | const char *name; | 7 | const char *name; |
8 | cgit_cmd_fn fn; | 8 | cgit_cmd_fn fn; |
9 | unsigned int want_repo:1, | 9 | unsigned int want_repo:1, |
10 | want_layout:1; | 10 | want_layout:1, |
11 | want_vpath:1; | ||
11 | }; | 12 | }; |
12 | 13 | ||
13 | extern struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx); | 14 | extern struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx); |