diff options
| author | John Keeping | 2014-10-05 10:59:02 +0100 |
|---|---|---|
| committer | Lukas Fleischer | 2014-12-13 12:38:42 +0100 |
| commit | eeddb5bc0905d4728001a111a9b1eb60ecccf9bd (patch) | |
| tree | e1193c55a604584acc8e3198838b358d44a65133 | |
| parent | 49f607777fe3d9393574a572d72caa568ee3ca3c (diff) | |
| download | cgit-eeddb5bc0905d4728001a111a9b1eb60ecccf9bd.tar.gz cgit-eeddb5bc0905d4728001a111a9b1eb60ecccf9bd.tar.bz2 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>
| -rw-r--r-- | ui-commit.c | 4 | ||||
| -rw-r--r-- | ui-log.c | 4 | ||||
| -rw-r--r-- | ui-refs.c | 2 | ||||
| -rw-r--r-- | ui-shared.c | 11 | ||||
| -rw-r--r-- | ui-shared.h | 3 |
5 files changed, 11 insertions, 13 deletions
diff --git a/ui-commit.c b/ui-commit.c index c48bfe8..ec99264 100644 --- a/ui-commit.c +++ b/ui-commit.c | |||
| @@ -67,7 +67,7 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
| 67 | html("</td></tr>\n"); | 67 | html("</td></tr>\n"); |
| 68 | html("<tr><th>commit</th><td colspan='2' class='sha1'>"); | 68 | html("<tr><th>commit</th><td colspan='2' class='sha1'>"); |
| 69 | tmp = sha1_to_hex(commit->object.sha1); | 69 | tmp = sha1_to_hex(commit->object.sha1); |
| 70 | cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix, 0); | 70 | cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix); |
| 71 | html(" ("); | 71 | html(" ("); |
| 72 | cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); | 72 | cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); |
| 73 | html(")</td></tr>\n"); | 73 | html(")</td></tr>\n"); |
| @@ -96,7 +96,7 @@ void cgit_print_commit(char *hex, const char *prefix) | |||
| 96 | parent_info = cgit_parse_commit(parent); | 96 | parent_info = cgit_parse_commit(parent); |
| 97 | tmp2 = parent_info->subject; | 97 | tmp2 = parent_info->subject; |
| 98 | } | 98 | } |
| 99 | cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix, 0); | 99 | cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix); |
| 100 | html(" ("); | 100 | html(" ("); |
| 101 | cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, | 101 | cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, |
| 102 | sha1_to_hex(p->item->object.sha1), prefix, 0); | 102 | sha1_to_hex(p->item->object.sha1), prefix, 0); |
| @@ -90,7 +90,7 @@ void show_commit_decorations(struct commit *commit) | |||
| 90 | strncpy(buf, deco->name, sizeof(buf) - 1); | 90 | strncpy(buf, deco->name, sizeof(buf) - 1); |
| 91 | cgit_commit_link(buf, NULL, "deco", ctx.qry.head, | 91 | cgit_commit_link(buf, NULL, "deco", ctx.qry.head, |
| 92 | sha1_to_hex(commit->object.sha1), | 92 | sha1_to_hex(commit->object.sha1), |
| 93 | ctx.qry.vpath, 0); | 93 | ctx.qry.vpath); |
| 94 | } | 94 | } |
| 95 | next: | 95 | next: |
| 96 | deco = deco->next; | 96 | deco = deco->next; |
| @@ -165,7 +165,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) | |||
| 165 | } | 165 | } |
| 166 | } | 166 | } |
| 167 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, | 167 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
| 168 | sha1_to_hex(commit->object.sha1), ctx.qry.vpath, 0); | 168 | sha1_to_hex(commit->object.sha1), ctx.qry.vpath); |
| 169 | show_commit_decorations(commit); | 169 | show_commit_decorations(commit); |
| 170 | html("</td><td>"); | 170 | html("</td><td>"); |
| 171 | cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); | 171 | cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); |
| @@ -67,7 +67,7 @@ static int print_branch(struct refinfo *ref) | |||
| 67 | html("</td><td>"); | 67 | html("</td><td>"); |
| 68 | 68 | ||
| 69 | if (ref->object->type == OBJ_COMMIT) { | 69 | if (ref->object->type == OBJ_COMMIT) { |
| 70 | cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL, 0); | 70 | cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL); |
| 71 | html("</td><td>"); | 71 | html("</td><td>"); |
| 72 | cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs"); | 72 | cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs"); |
| 73 | html_txt(info->author); | 73 | html_txt(info->author); |
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 | ||
| 330 | void cgit_commit_link(char *name, const char *title, const char *class, | 330 | void 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 = "&"; | 347 | delim = "&"; |
| 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 = "&"; | 352 | delim = "&"; |
| @@ -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) |
diff --git a/ui-shared.h b/ui-shared.h index 3e7a91b..bb193ec 100644 --- a/ui-shared.h +++ b/ui-shared.h | |||
| @@ -30,8 +30,7 @@ extern void cgit_log_link(const char *name, const char *title, | |||
| 30 | const char *pattern, int showmsg); | 30 | const char *pattern, int showmsg); |
| 31 | extern void cgit_commit_link(char *name, const char *title, | 31 | extern void cgit_commit_link(char *name, const char *title, |
| 32 | const char *class, const char *head, | 32 | const char *class, const char *head, |
| 33 | const char *rev, const char *path, | 33 | const char *rev, const char *path); |
| 34 | int toggle_ssdiff); | ||
| 35 | extern void cgit_patch_link(const char *name, const char *title, | 34 | extern void cgit_patch_link(const char *name, const char *title, |
| 36 | const char *class, const char *head, | 35 | const char *class, const char *head, |
| 37 | const char *rev, const char *path); | 36 | const char *rev, const char *path); |
