summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2009-08-17 08:17:23 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2009-08-17 08:17:23 (UTC)
commitcb92d05b6b729cd0e219b43d7a79aff832a9c1ac (patch) (side-by-side diff)
tree3324266f779b12bcf9f80ad5ee2f18f535832549
parent0730ee6ea4af45e29e7c74d4a32bde9d2d6c8104 (diff)
parent435a1da8d1c43bff2f2ccd5649ea8510eec0b2af (diff)
downloadcgit-cb92d05b6b729cd0e219b43d7a79aff832a9c1ac.zip
cgit-cb92d05b6b729cd0e219b43d7a79aff832a9c1ac.tar.gz
cgit-cb92d05b6b729cd0e219b43d7a79aff832a9c1ac.tar.bz2
Merge branch 'stable'
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--cgit.c3
-rw-r--r--ui-tag.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/cgit.c b/cgit.c
index 66dd140..5816f3d 100644
--- a/cgit.c
+++ b/cgit.c
@@ -172,16 +172,19 @@ void config_cb(const char *name, const char *value)
else
ctx.repo->readme = xstrdup(fmt("%s/%s", ctx.repo->path, value));
} else if (!strcmp(name, "include"))
parse_configfile(value, config_cb);
}
static void querystring_cb(const char *name, const char *value)
{
+ if (!value)
+ value = "";
+
if (!strcmp(name,"r")) {
ctx.qry.repo = xstrdup(value);
ctx.repo = cgit_get_repoinfo(value);
} else if (!strcmp(name, "p")) {
ctx.qry.page = xstrdup(value);
} else if (!strcmp(name, "url")) {
ctx.qry.url = xstrdup(value);
cgit_parse_url(value);
diff --git a/ui-tag.c b/ui-tag.c
index a9c8670..c2d72af 100644
--- a/ui-tag.c
+++ b/ui-tag.c
@@ -32,17 +32,20 @@ static void print_tag_content(char *buf)
void cgit_print_tag(char *revname)
{
unsigned char sha1[20];
struct object *obj;
struct tag *tag;
struct taginfo *info;
- if (get_sha1(revname, sha1)) {
+ if (!revname)
+ revname = ctx.qry.head;
+
+ if (get_sha1(fmt("refs/tags/%s", revname), sha1)) {
cgit_print_error(fmt("Bad tag reference: %s", revname));
return;
}
obj = parse_object(sha1);
if (!obj) {
cgit_print_error(fmt("Bad object id: %s", sha1_to_hex(sha1)));
return;
}