From 685872b770be2af643d00365d5358e46687f7385 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Thu, 10 Jun 2010 01:09:35 +0200 Subject: ui-commit: Preserve path limit in links to commit page This includes adding a path argument to cgit_commit_link() and updating all its callers. The callers from within the commit page (i.e. the "commit", "unidiff"/"side-by-side diff" and "parent" links) all preserve the path limit of the current commit page. All other callers pass NULL (i.e. no path limit). Signed-off-by: Johan Herland Signed-off-by: Lars Hjemli --- ui-commit.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ui-commit.c') diff --git a/ui-commit.c b/ui-commit.c index 1793921..2d98ed9 100644 --- a/ui-commit.c +++ b/ui-commit.c @@ -58,14 +58,14 @@ void cgit_print_commit(char *hex, const char *prefix) html("\n"); html("commit"); tmp = sha1_to_hex(commit->object.sha1); - cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, 0); + cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix, 0); html(" ("); cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); html(") ("); if ((ctx.qry.ssdiff && !ctx.cfg.ssdiff) || (!ctx.qry.ssdiff && ctx.cfg.ssdiff)) - cgit_commit_link("unidiff", NULL, NULL, ctx.qry.head, tmp, 1); + cgit_commit_link("unidiff", NULL, NULL, ctx.qry.head, tmp, prefix, 1); else - cgit_commit_link("side-by-side diff", NULL, NULL, ctx.qry.head, tmp, 1); + cgit_commit_link("side-by-side diff", NULL, NULL, ctx.qry.head, tmp, prefix, 1); html(")\n"); html("tree"); tmp = xstrdup(hex); @@ -87,7 +87,8 @@ void cgit_print_commit(char *hex, const char *prefix) html("parent" ""); cgit_commit_link(sha1_to_hex(p->item->object.sha1), NULL, NULL, - ctx.qry.head, sha1_to_hex(p->item->object.sha1), 0); + ctx.qry.head, + sha1_to_hex(p->item->object.sha1), prefix, 0); html(" ("); cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, sha1_to_hex(p->item->object.sha1), prefix, 0); -- cgit v1.2.3-24-g4f1b