aboutsummaryrefslogtreecommitdiffstats
path: root/ui-commit.c
diff options
context:
space:
mode:
authorChristian Hesse2016-09-29 21:41:09 +0200
committerChristian Hesse2016-10-04 09:47:18 +0200
commit3a0fd5e6b881e6a38a6be9224db0cf93512c0b2b (patch)
tree3598b714bb3dfc4585987850bfe23f93a046e7bf /ui-commit.c
parent6e4b7b6776eb994e795fa38b2619db6c55e10ecc (diff)
downloadcgit-3a0fd5e6b881e6a38a6be9224db0cf93512c0b2b.tar.gz
cgit-3a0fd5e6b881e6a38a6be9224db0cf93512c0b2b.tar.bz2
cgit-3a0fd5e6b881e6a38a6be9224db0cf93512c0b2b.zip
ui-commit: replace 'unsigned char sha1[20]' with 'struct object_id oid'
Upstream git is replacing 'unsigned char sha1[20]' with 'struct object_id oid'. We have some code that can be changed independent from upstream. So here we go...
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