about summary refs log tree commit diff stats
path: root/ui-commit.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-commit.c')
-rw-r--r--ui-commit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui-commit.c b/ui-commit.c index 099d294..db69d54 100644 --- a/ui-commit.c +++ b/ui-commit.c
@@ -19,19 +19,19 @@ void cgit_print_commit(char *hex, const char *prefix)
19 struct commitinfo *info, *parent_info; 19 struct commitinfo *info, *parent_info;
20 struct commit_list *p; 20 struct commit_list *p;
21 struct strbuf notes = STRBUF_INIT; 21 struct strbuf notes = STRBUF_INIT;
22 unsigned char sha1[20]; 22 struct object_id oid;
23 char *tmp, *tmp2; 23 char *tmp, *tmp2;
24 int parents = 0; 24 int parents = 0;
25 25
26 if (!hex) 26 if (!hex)
27 hex = ctx.qry.head; 27 hex = ctx.qry.head;
28 28
29 if (get_sha1(hex, sha1)) { 29 if (get_oid(hex, &oid)) {
30 cgit_print_error_page(400, "Bad request", 30 cgit_print_error_page(400, "Bad request",
31 "Bad object id: %s", hex); 31 "Bad object id: %s", hex);
32 return; 32 return;
33 } 33 }
34 commit = lookup_commit_reference(sha1); 34 commit = lookup_commit_reference(oid.hash);
35 if (!commit) { 35 if (!commit) {
36 cgit_print_error_page(404, "Not found", 36 cgit_print_error_page(404, "Not found",
37 "Bad commit reference: %s", hex); 37 "Bad commit reference: %s", hex);
@@ -39,7 +39,7 @@ void cgit_print_commit(char *hex, const char *prefix)
39 } 39 }
40 info = cgit_parse_commit(commit); 40 info = cgit_parse_commit(commit);
41 41
42 format_display_notes(sha1, &notes, PAGE_ENCODING, 0); 42 format_display_notes(oid.hash, &notes, PAGE_ENCODING, 0);
43 43
44 load_ref_decorations(DECORATE_FULL_REFS); 44 load_ref_decorations(DECORATE_FULL_REFS);
45 45