aboutsummaryrefslogtreecommitdiff
path: root/ui-shared.c
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 497dfd0..9dde0a3 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -328,7 +328,8 @@ void cgit_log_link(const char *name, const char *title, const char *class,
}
void cgit_commit_link(char *name, const char *title, const char *class,
- const char *head, const char *rev, const char *path)
+ const char *head, const char *rev, const char *path,
+ int toggle_ssdiff)
{
if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) {
name[ctx.cfg.max_msg_len] = '\0';
@@ -346,7 +347,7 @@ void cgit_commit_link(char *name, const char *title, const char *class,
html_url_arg(rev);
delim = "&";
}
- if (ctx.qry.ssdiff) {
+ if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) {
html(delim);
html("ss=1");
delim = "&";
@@ -462,7 +463,7 @@ static void cgit_self_link(char *name, const char *title, const char *class)
else if (!strcmp(ctx.qry.page, "commit"))
cgit_commit_link(name, title, class, ctx.qry.head,
ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
- ctx.qry.path);
+ ctx.qry.path, 0);
else if (!strcmp(ctx.qry.page, "patch"))
cgit_patch_link(name, title, class, ctx.qry.head,
ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
@@ -502,7 +503,7 @@ void cgit_object_link(struct object *obj)
shortrev[10] = '\0';
if (obj->type == OBJ_COMMIT) {
cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
- ctx.qry.head, fullrev, NULL);
+ ctx.qry.head, fullrev, NULL, 0);
return;
} else if (obj->type == OBJ_TREE)
page = "tree";
@@ -874,7 +875,7 @@ void cgit_print_pageheader(void)
cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head,
ctx.qry.sha1, ctx.qry.vpath);
cgit_commit_link("commit", NULL, hc("commit"),
- ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath);
+ ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath, 0);
cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head,
ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath, 0);
if (ctx.repo->max_stats)