-rw-r--r-- | ui-commit.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ui-commit.c b/ui-commit.c index 885f870..8864fc6 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -143,32 +143,35 @@ void inspect_filepair(struct diff_filepair *pair) | |||
143 | total_adds += lines_added; | 143 | total_adds += lines_added; |
144 | total_rems += lines_removed; | 144 | total_rems += lines_removed; |
145 | } | 145 | } |
146 | 146 | ||
147 | 147 | ||
148 | void cgit_print_commit(const char *hex) | 148 | void cgit_print_commit(const char *hex) |
149 | { | 149 | { |
150 | struct commit *commit, *parent; | 150 | struct commit *commit, *parent; |
151 | struct commitinfo *info; | 151 | struct commitinfo *info; |
152 | struct commit_list *p; | 152 | struct commit_list *p; |
153 | unsigned char sha1[20]; | 153 | unsigned char sha1[20]; |
154 | char *query; | 154 | char *query; |
155 | char *filename; | 155 | char *filename; |
156 | char *tmp; | 156 | char *tmp; |
157 | int i; | 157 | int i; |
158 | 158 | ||
159 | if (!hex) | ||
160 | hex = cgit_query_head; | ||
161 | |||
159 | if (get_sha1(hex, sha1)) { | 162 | if (get_sha1(hex, sha1)) { |
160 | cgit_print_error(fmt("Bad object id: %s", hex)); | 163 | cgit_print_error(fmt("Bad object id: %s", hex)); |
161 | return; | 164 | return; |
162 | } | 165 | } |
163 | commit = lookup_commit_reference(sha1); | 166 | commit = lookup_commit_reference(sha1); |
164 | if (!commit) { | 167 | if (!commit) { |
165 | cgit_print_error(fmt("Bad commit reference: %s", hex)); | 168 | cgit_print_error(fmt("Bad commit reference: %s", hex)); |
166 | return; | 169 | return; |
167 | } | 170 | } |
168 | info = cgit_parse_commit(commit); | 171 | info = cgit_parse_commit(commit); |
169 | 172 | ||
170 | html("<table class='commit-info'>\n"); | 173 | html("<table class='commit-info'>\n"); |
171 | html("<tr><th>author</th><td>"); | 174 | html("<tr><th>author</th><td>"); |
172 | html_txt(info->author); | 175 | html_txt(info->author); |
173 | html(" "); | 176 | html(" "); |
174 | html_txt(info->author_email); | 177 | html_txt(info->author_email); |