X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/3a0fd5e6b881e6a38a6be9224db0cf93512c0b2b..cc6d9cc7fc010db9be6c2d90fd054fb2d189d629:/ui-commit.c
diff --git a/ui-commit.c b/ui-commit.c
index db69d54..948118c 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -31,7 +31,7 @@ void cgit_print_commit(char *hex, const char *prefix)
"Bad object id: %s", hex);
return;
}
- commit = lookup_commit_reference(oid.hash);
+ commit = lookup_commit_reference(the_repository, &oid);
if (!commit) {
cgit_print_error_page(404, "Not found",
"Bad commit reference: %s", hex);
@@ -39,9 +39,9 @@ void cgit_print_commit(char *hex, const char *prefix)
}
info = cgit_parse_commit(commit);
- format_display_notes(oid.hash, ¬es, PAGE_ENCODING, 0);
+ format_display_notes(&oid, ¬es, PAGE_ENCODING, 0);
- load_ref_decorations(DECORATE_FULL_REFS);
+ load_ref_decorations(NULL, DECORATE_FULL_REFS);
cgit_print_layout_start();
cgit_print_diff_ctrls();
@@ -70,15 +70,15 @@ void cgit_print_commit(char *hex, const char *prefix)
html_txt(show_date(info->committer_date, info->committer_tz,
cgit_date_mode(DATE_ISO8601)));
html("\n");
- html("
| commit | ");
+ html(" |
|---|
| commit | ");
tmp = oid_to_hex(&commit->object.oid);
cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix);
html(" (");
cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix);
html(") |
\n");
- html("| tree | ");
+ html(" |
|---|
| tree | ");
tmp = xstrdup(hex);
- cgit_tree_link(oid_to_hex(&commit->tree->object.oid), NULL, NULL,
+ cgit_tree_link(oid_to_hex(get_commit_tree_oid(commit)), NULL, NULL,
ctx.qry.head, tmp, NULL);
if (prefix) {
html(" /");
@@ -87,7 +87,7 @@ void cgit_print_commit(char *hex, const char *prefix)
free(tmp);
html(" |
\n");
for (p = commit->parents; p; p = p->next) {
- parent = lookup_commit_reference(p->item->object.oid.hash);
+ parent = lookup_commit_reference(the_repository, &p->item->object.oid);
if (!parent) {
html("| ");
cgit_print_error("Error reading parent commit");
@@ -95,7 +95,7 @@ void cgit_print_commit(char *hex, const char *prefix)
continue;
}
html(" |
| parent | "
- "");
+ " | ");
tmp = tmp2 = oid_to_hex(&p->item->object.oid);
if (ctx.repo->enable_subject_links) {
parent_info = cgit_parse_commit(parent);
@@ -109,9 +109,8 @@ void cgit_print_commit(char *hex, const char *prefix)
parents++;
}
if (ctx.repo->snapshots) {
- html(" |
|---|
| download | ");
- cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head,
- hex, ctx.repo->snapshots);
+ html(" |
|---|
| download | ");
+ cgit_print_snapshot_links(ctx.repo, hex, " ");
html(" |
");
}
html("\n");
@@ -140,7 +139,7 @@ void cgit_print_commit(char *hex, const char *prefix)
tmp = oid_to_hex(&commit->parents->item->object.oid);
else
tmp = NULL;
- cgit_print_diff(ctx.qry.sha1, tmp, prefix, 0, 0);
+ cgit_print_diff(ctx.qry.oid, tmp, prefix, 0, 0);
}
strbuf_release(¬es);
cgit_free_commitinfo(info);