-rw-r--r-- | ui-commit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui-commit.c b/ui-commit.c index b3d1c28..20a7cb2 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
@@ -165,49 +165,50 @@ void cgit_print_commit(const char *hex) | |||
165 | } | 165 | } |
166 | commit = lookup_commit_reference(sha1); | 166 | commit = lookup_commit_reference(sha1); |
167 | if (!commit) { | 167 | if (!commit) { |
168 | cgit_print_error(fmt("Bad commit reference: %s", hex)); | 168 | cgit_print_error(fmt("Bad commit reference: %s", hex)); |
169 | return; | 169 | return; |
170 | } | 170 | } |
171 | info = cgit_parse_commit(commit); | 171 | info = cgit_parse_commit(commit); |
172 | 172 | ||
173 | html("<table class='commit-info'>\n"); | 173 | html("<table class='commit-info'>\n"); |
174 | html("<tr><th>author</th><td>"); | 174 | html("<tr><th>author</th><td>"); |
175 | html_txt(info->author); | 175 | html_txt(info->author); |
176 | html(" "); | 176 | html(" "); |
177 | html_txt(info->author_email); | 177 | html_txt(info->author_email); |
178 | html("</td><td class='right'>"); | 178 | html("</td><td class='right'>"); |
179 | cgit_print_date(info->author_date); | 179 | cgit_print_date(info->author_date); |
180 | html("</td></tr>\n"); | 180 | html("</td></tr>\n"); |
181 | html("<tr><th>committer</th><td>"); | 181 | html("<tr><th>committer</th><td>"); |
182 | html_txt(info->committer); | 182 | html_txt(info->committer); |
183 | html(" "); | 183 | html(" "); |
184 | html_txt(info->committer_email); | 184 | html_txt(info->committer_email); |
185 | html("</td><td class='right'>"); | 185 | html("</td><td class='right'>"); |
186 | cgit_print_date(info->committer_date); | 186 | cgit_print_date(info->committer_date); |
187 | html("</td></tr>\n"); | 187 | html("</td></tr>\n"); |
188 | html("<tr><th>tree</th><td colspan='2' class='sha1'><a href='"); | 188 | html("<tr><th>tree</th><td colspan='2' class='sha1'><a href='"); |
189 | query = fmt("id=%s", sha1_to_hex(commit->tree->object.sha1)); | 189 | query = fmt("h=%s&id=%s", sha1_to_hex(commit->object.sha1), |
190 | sha1_to_hex(commit->tree->object.sha1)); | ||
190 | html_attr(cgit_pageurl(cgit_query_repo, "tree", query)); | 191 | html_attr(cgit_pageurl(cgit_query_repo, "tree", query)); |
191 | htmlf("'>%s</a></td></tr>\n", sha1_to_hex(commit->tree->object.sha1)); | 192 | htmlf("'>%s</a></td></tr>\n", sha1_to_hex(commit->tree->object.sha1)); |
192 | for (p = commit->parents; p ; p = p->next) { | 193 | for (p = commit->parents; p ; p = p->next) { |
193 | parent = lookup_commit_reference(p->item->object.sha1); | 194 | parent = lookup_commit_reference(p->item->object.sha1); |
194 | if (!parent) { | 195 | if (!parent) { |
195 | html("<tr><td colspan='3'>"); | 196 | html("<tr><td colspan='3'>"); |
196 | cgit_print_error("Error reading parent commit"); | 197 | cgit_print_error("Error reading parent commit"); |
197 | html("</td></tr>"); | 198 | html("</td></tr>"); |
198 | continue; | 199 | continue; |
199 | } | 200 | } |
200 | html("<tr><th>parent</th>" | 201 | html("<tr><th>parent</th>" |
201 | "<td colspan='2' class='sha1'>" | 202 | "<td colspan='2' class='sha1'>" |
202 | "<a href='"); | 203 | "<a href='"); |
203 | query = fmt("id=%s", sha1_to_hex(p->item->object.sha1)); | 204 | query = fmt("id=%s", sha1_to_hex(p->item->object.sha1)); |
204 | html_attr(cgit_pageurl(cgit_query_repo, "commit", query)); | 205 | html_attr(cgit_pageurl(cgit_query_repo, "commit", query)); |
205 | htmlf("'>%s</a> (<a href='", | 206 | htmlf("'>%s</a> (<a href='", |
206 | sha1_to_hex(p->item->object.sha1)); | 207 | sha1_to_hex(p->item->object.sha1)); |
207 | query = fmt("id=%s&id2=%s", sha1_to_hex(parent->tree->object.sha1), | 208 | query = fmt("id=%s&id2=%s", sha1_to_hex(parent->tree->object.sha1), |
208 | sha1_to_hex(commit->tree->object.sha1)); | 209 | sha1_to_hex(commit->tree->object.sha1)); |
209 | html_attr(cgit_pageurl(cgit_query_repo, "diff", query)); | 210 | html_attr(cgit_pageurl(cgit_query_repo, "diff", query)); |
210 | html("'>diff</a>)</td></tr>"); | 211 | html("'>diff</a>)</td></tr>"); |
211 | } | 212 | } |
212 | if (cgit_repo->snapshots) { | 213 | if (cgit_repo->snapshots) { |
213 | htmlf("<tr><th>download</th><td colspan='2' class='sha1'><a href='"); | 214 | htmlf("<tr><th>download</th><td colspan='2' class='sha1'><a href='"); |