about summary refs log tree commit diff stats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorJohn Keeping2014-10-05 10:59:02 +0100
committerLukas Fleischer2014-12-13 12:38:42 +0100
commiteeddb5bc0905d4728001a111a9b1eb60ecccf9bd (patch)
treee1193c55a604584acc8e3198838b358d44a65133 /ui-shared.c
parentgit: update to v2.0.4 (diff)
downloadcgit-eeddb5bc0905d4728001a111a9b1eb60ecccf9bd.tar.gz
cgit-eeddb5bc0905d4728001a111a9b1eb60ecccf9bd.zip
ui-shared: remove toggle_ssdiff arg to cgit_commit_link()
This argument is never used with a value other than zero, so remove it
and simplify the code.

Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ui-shared.c b/ui-shared.c index 9dde0a3..497dfd0 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -328,8 +328,7 @@ void cgit_log_link(const char *name, const char *title, const char *class,
328} 328}
329 329
330void cgit_commit_link(char *name, const char *title, const char *class, 330void cgit_commit_link(char *name, const char *title, const char *class,
331 const char *head, const char *rev, const char *path, 331 const char *head, const char *rev, const char *path)
332 int toggle_ssdiff)
333{ 332{
334 if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) { 333 if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) {
335 name[ctx.cfg.max_msg_len] = '\0'; 334 name[ctx.cfg.max_msg_len] = '\0';
@@ -347,7 +346,7 @@ void cgit_commit_link(char *name, const char *title, const char *class,
347 html_url_arg(rev); 346 html_url_arg(rev);
348 delim = "&amp;"; 347 delim = "&amp;";
349 } 348 }
350 if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) { 349 if (ctx.qry.ssdiff) {
351 html(delim); 350 html(delim);
352 html("ss=1"); 351 html("ss=1");
353 delim = "&amp;"; 352 delim = "&amp;";
@@ -463,7 +462,7 @@ static void cgit_self_link(char *name, const char *title, const char *class)
463 else if (!strcmp(ctx.qry.page, "commit")) 462 else if (!strcmp(ctx.qry.page, "commit"))
464 cgit_commit_link(name, title, class, ctx.qry.head, 463 cgit_commit_link(name, title, class, ctx.qry.head,
465 ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, 464 ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
466 ctx.qry.path, 0); 465 ctx.qry.path);
467 else if (!strcmp(ctx.qry.page, "patch")) 466 else if (!strcmp(ctx.qry.page, "patch"))
468 cgit_patch_link(name, title, class, ctx.qry.head, 467 cgit_patch_link(name, title, class, ctx.qry.head,
469 ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, 468 ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
@@ -503,7 +502,7 @@ void cgit_object_link(struct object *obj)
503 shortrev[10] = '\0'; 502 shortrev[10] = '\0';
504 if (obj->type == OBJ_COMMIT) { 503 if (obj->type == OBJ_COMMIT) {
505 cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL, 504 cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
506 ctx.qry.head, fullrev, NULL, 0); 505 ctx.qry.head, fullrev, NULL);
507 return; 506 return;
508 } else if (obj->type == OBJ_TREE) 507 } else if (obj->type == OBJ_TREE)
509 page = "tree"; 508 page = "tree";
@@ -875,7 +874,7 @@ void cgit_print_pageheader(void)
875 cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head, 874 cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head,
876 ctx.qry.sha1, ctx.qry.vpath); 875 ctx.qry.sha1, ctx.qry.vpath);
877 cgit_commit_link("commit", NULL, hc("commit"), 876 cgit_commit_link("commit", NULL, hc("commit"),
878 ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath, 0); 877 ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath);
879 cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head, 878 cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head,
880 ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath, 0); 879 ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath, 0);
881 if (ctx.repo->max_stats) 880 if (ctx.repo->max_stats)