summaryrefslogtreecommitdiffabout
path: root/ui-commit.c
Unidiff
Diffstat (limited to 'ui-commit.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-commit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui-commit.c b/ui-commit.c
index 3b0919b..25721ca 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -173,52 +173,52 @@ void cgit_print_commit(char *hex)
173 cgit_print_date(info->committer_date, FMT_LONGDATE); 173 cgit_print_date(info->committer_date, FMT_LONGDATE);
174 html("</td></tr>\n"); 174 html("</td></tr>\n");
175 html("<tr><th>tree</th><td colspan='2' class='sha1'>"); 175 html("<tr><th>tree</th><td colspan='2' class='sha1'>");
176 tmp = xstrdup(hex); 176 tmp = xstrdup(hex);
177 cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL, 177 cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL,
178 ctx.qry.head, tmp, NULL); 178 ctx.qry.head, tmp, NULL);
179 html("</td></tr>\n"); 179 html("</td></tr>\n");
180 for (p = commit->parents; p ; p = p->next) { 180 for (p = commit->parents; p ; p = p->next) {
181 parent = lookup_commit_reference(p->item->object.sha1); 181 parent = lookup_commit_reference(p->item->object.sha1);
182 if (!parent) { 182 if (!parent) {
183 html("<tr><td colspan='3'>"); 183 html("<tr><td colspan='3'>");
184 cgit_print_error("Error reading parent commit"); 184 cgit_print_error("Error reading parent commit");
185 html("</td></tr>"); 185 html("</td></tr>");
186 continue; 186 continue;
187 } 187 }
188 html("<tr><th>parent</th>" 188 html("<tr><th>parent</th>"
189 "<td colspan='2' class='sha1'>"); 189 "<td colspan='2' class='sha1'>");
190 cgit_commit_link(sha1_to_hex(p->item->object.sha1), NULL, NULL, 190 cgit_commit_link(sha1_to_hex(p->item->object.sha1), NULL, NULL,
191 ctx.qry.head, sha1_to_hex(p->item->object.sha1)); 191 ctx.qry.head, sha1_to_hex(p->item->object.sha1));
192 html(" ("); 192 html(" (");
193 cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, 193 cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex,
194 sha1_to_hex(p->item->object.sha1), NULL); 194 sha1_to_hex(p->item->object.sha1), NULL);
195 html(")</td></tr>"); 195 html(")</td></tr>");
196 } 196 }
197 if (cgit_repo->snapshots) { 197 if (ctx.repo->snapshots) {
198 html("<tr><th>download</th><td colspan='2' class='sha1'>"); 198 html("<tr><th>download</th><td colspan='2' class='sha1'>");
199 cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head, 199 cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head,
200 hex, cgit_repo->snapshots); 200 hex, ctx.repo->snapshots);
201 html("</td></tr>"); 201 html("</td></tr>");
202 } 202 }
203 html("</table>\n"); 203 html("</table>\n");
204 html("<div class='commit-subject'>"); 204 html("<div class='commit-subject'>");
205 html_txt(info->subject); 205 html_txt(info->subject);
206 html("</div>"); 206 html("</div>");
207 html("<div class='commit-msg'>"); 207 html("<div class='commit-msg'>");
208 html_txt(info->msg); 208 html_txt(info->msg);
209 html("</div>"); 209 html("</div>");
210 if (!(commit->parents && commit->parents->next && commit->parents->next->next)) { 210 if (!(commit->parents && commit->parents->next && commit->parents->next->next)) {
211 html("<div class='diffstat-header'>Diffstat</div>"); 211 html("<div class='diffstat-header'>Diffstat</div>");
212 html("<table summary='diffstat' class='diffstat'>"); 212 html("<table summary='diffstat' class='diffstat'>");
213 max_changes = 0; 213 max_changes = 0;
214 cgit_diff_commit(commit, inspect_filepair); 214 cgit_diff_commit(commit, inspect_filepair);
215 for(i = 0; i<files; i++) 215 for(i = 0; i<files; i++)
216 print_fileinfo(&items[i]); 216 print_fileinfo(&items[i]);
217 html("</table>"); 217 html("</table>");
218 html("<div class='diffstat-summary'>"); 218 html("<div class='diffstat-summary'>");
219 htmlf("%d files changed, %d insertions, %d deletions (", 219 htmlf("%d files changed, %d insertions, %d deletions (",
220 files, total_adds, total_rems); 220 files, total_adds, total_rems);
221 cgit_diff_link("show diff", NULL, NULL, ctx.qry.head, hex, 221 cgit_diff_link("show diff", NULL, NULL, ctx.qry.head, hex,
222 NULL, NULL); 222 NULL, NULL);
223 html(")</div>"); 223 html(")</div>");
224 } 224 }