]> gitweb.ps.run Git - ps-cgit/commitdiff
Include diff in commit view
authorLars Hjemli <hjemli@gmail.com>
Sat, 12 Apr 2008 13:53:53 +0000 (15:53 +0200)
committerLars Hjemli <hjemli@gmail.com>
Sat, 12 Apr 2008 18:00:40 +0000 (20:00 +0200)
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
ui-commit.c

index 8019e3608f0fd35911024d2b8294e61e864831a2..c2fafd78f1c60f3c93705ec4ffed96918fdaa5e8 100644 (file)
@@ -9,6 +9,7 @@
 #include "cgit.h"
 #include "html.h"
 #include "ui-shared.h"
+#include "ui-diff.h"
 
 static int files, slots;
 static int total_adds, total_rems, max_changes;
@@ -218,10 +219,11 @@ void cgit_print_commit(char *hex)
                        print_fileinfo(&items[i]);
                html("</table>");
                html("<div class='diffstat-summary'>");
-               htmlf("%d files changed, %d insertions, %d deletions (",
+               htmlf("%d files changed, %d insertions, %d deletions",
                      files, total_adds, total_rems);
-               cgit_diff_link("show diff", NULL, NULL, ctx.qry.head, hex,
-                              NULL, NULL);
+               cgit_print_diff(ctx.qry.sha1,
+                               sha1_to_hex(commit->parents->item->object.sha1),
+                               NULL);
                html(")</div>");
        }
        cgit_free_commitinfo(info);