-rw-r--r-- | ui-patch.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -72,17 +72,17 @@ static void filepair_cb(struct diff_filepair *pair) } if (cgit_diff_files(pair->one->sha1, pair->two->sha1, &old_size, &new_size, &binary, print_line)) html("Error running diff"); if (binary) html("Binary files differ\n"); } -void cgit_print_patch(char *hex) +void cgit_print_patch(char *hex, const char *prefix) { struct commit *commit; struct commitinfo *info; unsigned char sha1[20], old_sha1[20]; char *patchname; if (!hex) hex = ctx.qry.head; @@ -117,13 +117,15 @@ void cgit_print_patch(char *hex) cgit_print_date(info->author_date, "%a, %d %b %Y %H:%M:%S %z%n", ctx.cfg.local_time); htmlf("Subject: %s\n\n", info->subject); if (info->msg && *info->msg) { htmlf("%s", info->msg); if (info->msg[strlen(info->msg) - 1] != '\n') html("\n"); } html("---\n"); - cgit_diff_tree(old_sha1, sha1, filepair_cb, NULL); + if (prefix) + htmlf("(limited to '%s')\n\n", prefix); + cgit_diff_tree(old_sha1, sha1, filepair_cb, prefix); html("--\n"); htmlf("cgit %s\n", CGIT_VERSION); cgit_free_commitinfo(info); } |