diff options
author | Lars Hjemli <hjemli@gmail.com> | 2007-05-18 03:00:54 +0200 |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-18 22:51:01 +0200 |
commit | 30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de (patch) | |
tree | efb3eddd091117281d5592c9eab44bc63121edf6 /shared.c | |
parent | Add lookup-function for valid repo commands (diff) | |
download | cgit-pink-30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de.tar.gz cgit-pink-30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de.zip |
Enable url=value querystring parameter
This makes is possible to use repo-urls like '/pub/scm/git/git.git' and even add path specifications, like '/pub/scm/git/git.git/log/documentation'. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | shared.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/shared.c b/shared.c index fb05427..0b074da 100644 --- a/shared.c +++ b/shared.c @@ -10,6 +10,7 @@ struct repolist cgit_repolist; struct repoinfo *cgit_repo; +int cgit_cmd; char *cgit_root_title = "Git repository browser"; char *cgit_css = "/cgit.css"; @@ -184,8 +185,12 @@ void cgit_querystring_cb(const char *name, const char *value) { if (!strcmp(name,"r")) { cgit_query_repo = xstrdup(value); + cgit_repo = cgit_get_repoinfo(value); } else if (!strcmp(name, "p")) { cgit_query_page = xstrdup(value); + cgit_cmd = cgit_get_cmd_index(value); + } else if (!strcmp(name, "url")) { + cgit_parse_url(value); } else if (!strcmp(name, "q")) { cgit_query_search = xstrdup(value); } else if (!strcmp(name, "h")) { |