X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/a2ddc10479ec463708e422ca5ce7ec02c22a7d02..f9ff7df613b4ee86fe5914c4ae3400650882c03d:/ui-diff.c diff --git a/ui-diff.c b/ui-diff.c index 999b6f3..afe1c90 100644 --- a/ui-diff.c +++ b/ui-diff.c @@ -66,11 +66,23 @@ static void filepair_cb(struct diff_filepair *pair) html(""); } -void cgit_print_diff(const char *old_hex, const char *new_hex, char *path) +void cgit_print_diff(const char *head, const char *old_hex, const char *new_hex, char *path) { unsigned char sha1[20], sha2[20]; enum object_type type; unsigned long size; + struct commit *commit; + + if (head && !old_hex && !new_hex) { + get_sha1(head, sha1); + commit = lookup_commit_reference(sha1); + if (commit && !parse_commit(commit)) { + html("