-rw-r--r-- | ui-commit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui-commit.c b/ui-commit.c index 2d38f0b..2d36015 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -1,24 +1,32 @@ | |||
1 | /* ui-commit.c: generate commit view | ||
2 | * | ||
3 | * Copyright (C) 2006 Lars Hjemli | ||
4 | * | ||
5 | * Licensed under GNU General Public License v2 | ||
6 | * (see COPYING for full license text) | ||
7 | */ | ||
8 | |||
1 | #include "cgit.h" | 9 | #include "cgit.h" |
2 | 10 | ||
3 | void cgit_print_commit(const char *hex) | 11 | void cgit_print_commit(const char *hex) |
4 | { | 12 | { |
5 | struct commit *commit; | 13 | struct commit *commit; |
6 | struct commitinfo *info; | 14 | struct commitinfo *info; |
7 | struct commit_list *p; | 15 | struct commit_list *p; |
8 | unsigned long size; | 16 | unsigned long size; |
9 | char type[20]; | 17 | char type[20]; |
10 | char *buf; | 18 | char *buf; |
11 | 19 | ||
12 | unsigned char sha1[20]; | 20 | unsigned char sha1[20]; |
13 | 21 | ||
14 | if (get_sha1(hex, sha1)) { | 22 | if (get_sha1(hex, sha1)) { |
15 | cgit_print_error(fmt("Bad object id: %s", hex)); | 23 | cgit_print_error(fmt("Bad object id: %s", hex)); |
16 | return; | 24 | return; |
17 | } | 25 | } |
18 | 26 | ||
19 | buf = read_sha1_file(sha1, type, &size); | 27 | buf = read_sha1_file(sha1, type, &size); |
20 | if (!buf) { | 28 | if (!buf) { |
21 | cgit_print_error(fmt("Bad object reference: %s", hex)); | 29 | cgit_print_error(fmt("Bad object reference: %s", hex)); |
22 | return; | 30 | return; |
23 | } | 31 | } |
24 | 32 | ||