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) (ignore 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
@@ -156,48 +156,51 @@ void config_cb(const char *name, const char *value)
ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value);
else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount"))
ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value);
else if (ctx.repo && !strcmp(name, "repo.max-stats"))
ctx.repo->max_stats = cgit_find_stats_period(value, NULL);
else if (ctx.repo && !strcmp(name, "repo.module-link"))
ctx.repo->module_link= xstrdup(value);
else if (ctx.repo && !strcmp(name, "repo.about-filter"))
ctx.repo->about_filter = new_filter(value, 0);
else if (ctx.repo && !strcmp(name, "repo.commit-filter"))
ctx.repo->commit_filter = new_filter(value, 0);
else if (ctx.repo && !strcmp(name, "repo.source-filter"))
ctx.repo->source_filter = new_filter(value, 1);
else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) {
if (*value == '/')
ctx.repo->readme = xstrdup(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);
} else if (!strcmp(name, "qt")) {
ctx.qry.grep = xstrdup(value);
} else if (!strcmp(name, "q")) {
ctx.qry.search = xstrdup(value);
} else if (!strcmp(name, "h")) {
ctx.qry.head = xstrdup(value);
ctx.qry.has_symref = 1;
} else if (!strcmp(name, "id")) {
ctx.qry.sha1 = xstrdup(value);
ctx.qry.has_sha1 = 1;
} else if (!strcmp(name, "id2")) {
ctx.qry.sha2 = xstrdup(value);
ctx.qry.has_sha1 = 1;
} else if (!strcmp(name, "ofs")) {
ctx.qry.ofs = atoi(value);
} else if (!strcmp(name, "path")) {
diff --git a/ui-tag.c b/ui-tag.c
index a9c8670..c2d72af 100644
--- a/ui-tag.c
+++ b/ui-tag.c
@@ -16,49 +16,52 @@ static void print_tag_content(char *buf)
if (!buf)
return;
html("<div class='commit-subject'>");
p = strchr(buf, '\n');
if (p)
*p = '\0';
html_txt(buf);
html("</div>");
if (p) {
html("<div class='commit-msg'>");
html_txt(++p);
html("</div>");
}
}
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;
}
if (obj->type == OBJ_TAG) {
tag = lookup_tag(sha1);
if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) {
cgit_print_error(fmt("Bad tag object: %s", revname));
return;
}
html("<table class='commit-info'>\n");
htmlf("<tr><td>Tag name</td><td>");
html_txt(revname);
htmlf(" (%s)</td></tr>\n", sha1_to_hex(sha1));
if (info->tagger_date > 0) {
html("<tr><td>Tag date</td><td>");
cgit_print_date(info->tagger_date, FMT_LONGDATE, ctx.cfg.local_time);
html("</td></tr>\n");
}
if (info->tagger) {