summaryrefslogtreecommitdiffabout
path: root/ui-commit.c
authorLars Hjemli <hjemli@gmail.com>2007-06-16 18:20:42 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-06-16 18:20:42 (UTC)
commitffc69736a606fd8f9a10468cce48b9a37b428944 (patch) (side-by-side diff)
treeb080c702391244a525fa0e7c97758f7f7fa0c383 /ui-commit.c
parent849f0f0f02f858e21fbe59295846e51628f82915 (diff)
downloadcgit-ffc69736a606fd8f9a10468cce48b9a37b428944.zip
cgit-ffc69736a606fd8f9a10468cce48b9a37b428944.tar.gz
cgit-ffc69736a606fd8f9a10468cce48b9a37b428944.tar.bz2
ui-tree: unify with ui-view, use path to select tree/blob
This teaches ui-tree to show both trees and blobs, thereby making ui-view superfluous. At the same time, ui-tree is extended to honour the specified path instead of requiering a tree/blob sha1.
Diffstat (limited to 'ui-commit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-commit.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ui-commit.c b/ui-commit.c
index 1d12bbb..ed5384d 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -161,50 +161,49 @@ void cgit_print_commit(const char *hex)
}
commit = lookup_commit_reference(sha1);
if (!commit) {
cgit_print_error(fmt("Bad commit reference: %s", hex));
return;
}
info = cgit_parse_commit(commit);
html("<table class='commit-info'>\n");
html("<tr><th>author</th><td>");
html_txt(info->author);
html(" ");
html_txt(info->author_email);
html("</td><td class='right'>");
cgit_print_date(info->author_date, FMT_LONGDATE);
html("</td></tr>\n");
html("<tr><th>committer</th><td>");
html_txt(info->committer);
html(" ");
html_txt(info->committer_email);
html("</td><td class='right'>");
cgit_print_date(info->committer_date, FMT_LONGDATE);
html("</td></tr>\n");
html("<tr><th>tree</th><td colspan='2' class='sha1'><a href='");
- query = fmt("h=%s&amp;id=%s", sha1_to_hex(commit->object.sha1),
- sha1_to_hex(commit->tree->object.sha1));
+ query = fmt("h=%s", sha1_to_hex(commit->object.sha1));
html_attr(cgit_pageurl(cgit_query_repo, "tree", query));
htmlf("'>%s</a></td></tr>\n", sha1_to_hex(commit->tree->object.sha1));
for (p = commit->parents; p ; p = p->next) {
parent = lookup_commit_reference(p->item->object.sha1);
if (!parent) {
html("<tr><td colspan='3'>");
cgit_print_error("Error reading parent commit");
html("</td></tr>");
continue;
}
html("<tr><th>parent</th>"
"<td colspan='2' class='sha1'>"
"<a href='");
query = fmt("h=%s", sha1_to_hex(p->item->object.sha1));
html_attr(cgit_pageurl(cgit_query_repo, "commit", query));
htmlf("'>%s</a> (<a href='",
sha1_to_hex(p->item->object.sha1));
query = fmt("id=%s&amp;id2=%s", sha1_to_hex(parent->tree->object.sha1),
sha1_to_hex(commit->tree->object.sha1));
html_attr(cgit_pageurl(cgit_query_repo, "diff", query));
html("'>diff</a>)</td></tr>");
}
if (cgit_repo->snapshots) {
htmlf("<tr><th>download</th><td colspan='2' class='sha1'><a href='");