Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Keep the range in a large diff's patch link
The link named only id, so for a diff between two commits it led to
a patch of the newer one alone, and without an id it lost the branch
as well and led to the default branch's tip.
Diffstat (limited to 'source/ui-shared.c')
| -rw-r--r-- | source/ui-shared.c | 14 |
1 file changed, 11 insertions, 3 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c index 0eeda44..0865ffa 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -605,7 +605,7 @@ static void self_link(const char *name, const char *title, const char *class) else if (!strcmp(ctx.qry.page, "commit")) cgit_commit_link(name, title, class, ctx.qry.head, rev, ctx.qry.path); else if (!strcmp(ctx.qry.page, "patch")) - cgit_patch_link(name, title, class, ctx.qry.head, rev, ctx.qry.path); + cgit_patch_link(name, title, class, ctx.qry.head, rev, ctx.qry.oid2, ctx.qry.path); else if (!strcmp(ctx.qry.page, "refs")) cgit_refs_link(name, title, class, ctx.qry.head, rev, ctx.qry.path); else if (!strcmp(ctx.qry.page, "snapshot")) @@ -920,9 +920,17 @@ void cgit_diff_link(const char *name, const char *title, const char *class, } void cgit_patch_link(const char *name, const char *title, const char *class, - const char *head, const char *rev, const char *path) + const char *head, const char *new_rev, const char *old_rev, const char *path) { - reporevlink("patch", name, title, class, head, rev, path); + const char *delim; + + delim = repolink(title, class, "patch", head, path); + delim = emit_rev_arg(delim, new_rev); + if (old_rev) + url_arg(delim, "id2", old_rev); + html("'>"); + html_txt(name); + html("</a>"); } void cgit_stats_link(const char *name, const char *title, const char *class, |
