]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-diff.c
Use GIT-1.6.0-rc0
[ps-cgit] / ui-diff.c
index 625b5fddd17418ec78dec2b736a03a2a1f1a8eed..1c182aa0eeed916ae1904a275c905017a599980c 100644 (file)
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -145,6 +145,7 @@ void cgit_print_diffstat(const unsigned char *old_sha1,
        html("<div class='diffstat-header'>Diffstat</div>");
        html("<table summary='diffstat' class='diffstat'>");
        max_changes = 0;
+       curr_rev = xstrdup(sha1_to_hex(new_sha1));
        cgit_diff_tree(old_sha1, new_sha1, inspect_filepair, NULL);
        for(i = 0; i<files; i++)
                print_fileinfo(&items[i]);
@@ -258,12 +259,6 @@ void cgit_print_diff(const char *new_rev, const char *old_rev, const char *prefi
                cgit_print_error(fmt("Bad object name: %s", new_rev));
                return;
        }
-       if (type != OBJ_COMMIT) {
-               cgit_print_error(fmt("Unhandled object type: %s",
-                                    typename(type)));
-               return;
-       }
-
        commit = lookup_commit_reference(new_rev_sha1);
        if (!commit || parse_commit(commit))
                cgit_print_error(fmt("Bad commit: %s", sha1_to_hex(new_rev_sha1)));