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>
Šī revīzija ir iekļauta:
John Keeping 2014-10-05 10:59:02 +01:00 revīziju iesūtīja Lukas Fleischer
vecāks 49f607777f
revīzija eeddb5bc09
5 mainīti faili ar 11 papildinājumiem un 13 dzēšanām

Parādīt failu

@ -67,7 +67,7 @@ void cgit_print_commit(char *hex, const char *prefix)
html("</td></tr>\n"); html("</td></tr>\n");
html("<tr><th>commit</th><td colspan='2' class='sha1'>"); html("<tr><th>commit</th><td colspan='2' class='sha1'>");
tmp = sha1_to_hex(commit->object.sha1); tmp = sha1_to_hex(commit->object.sha1);
cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix, 0); cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp, prefix);
html(" ("); html(" (");
cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix);
html(")</td></tr>\n"); html(")</td></tr>\n");
@ -96,7 +96,7 @@ void cgit_print_commit(char *hex, const char *prefix)
parent_info = cgit_parse_commit(parent); parent_info = cgit_parse_commit(parent);
tmp2 = parent_info->subject; tmp2 = parent_info->subject;
} }
cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix, 0); cgit_commit_link(tmp2, NULL, NULL, ctx.qry.head, tmp, prefix);
html(" ("); html(" (");
cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex,
sha1_to_hex(p->item->object.sha1), prefix, 0); sha1_to_hex(p->item->object.sha1), prefix, 0);

Parādīt failu

@ -90,7 +90,7 @@ void show_commit_decorations(struct commit *commit)
strncpy(buf, deco->name, sizeof(buf) - 1); strncpy(buf, deco->name, sizeof(buf) - 1);
cgit_commit_link(buf, NULL, "deco", ctx.qry.head, cgit_commit_link(buf, NULL, "deco", ctx.qry.head,
sha1_to_hex(commit->object.sha1), sha1_to_hex(commit->object.sha1),
ctx.qry.vpath, 0); ctx.qry.vpath);
} }
next: next:
deco = deco->next; deco = deco->next;
@ -165,7 +165,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
} }
} }
cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head,
sha1_to_hex(commit->object.sha1), ctx.qry.vpath, 0); sha1_to_hex(commit->object.sha1), ctx.qry.vpath);
show_commit_decorations(commit); show_commit_decorations(commit);
html("</td><td>"); html("</td><td>");
cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");

Parādīt failu

@ -67,7 +67,7 @@ static int print_branch(struct refinfo *ref)
html("</td><td>"); html("</td><td>");
if (ref->object->type == OBJ_COMMIT) { if (ref->object->type == OBJ_COMMIT) {
cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL, 0); cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL);
html("</td><td>"); html("</td><td>");
cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs"); cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs");
html_txt(info->author); html_txt(info->author);

Parādīt failu

@ -328,8 +328,7 @@ 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, 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) { if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) {
name[ctx.cfg.max_msg_len] = '\0'; name[ctx.cfg.max_msg_len] = '\0';
@ -347,7 +346,7 @@ void cgit_commit_link(char *name, const char *title, const char *class,
html_url_arg(rev); html_url_arg(rev);
delim = "&amp;"; delim = "&amp;";
} }
if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) { if (ctx.qry.ssdiff) {
html(delim); html(delim);
html("ss=1"); html("ss=1");
delim = "&amp;"; delim = "&amp;";
@ -463,7 +462,7 @@ static void cgit_self_link(char *name, const char *title, const char *class)
else if (!strcmp(ctx.qry.page, "commit")) else if (!strcmp(ctx.qry.page, "commit"))
cgit_commit_link(name, title, class, ctx.qry.head, cgit_commit_link(name, title, class, ctx.qry.head,
ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
ctx.qry.path, 0); ctx.qry.path);
else if (!strcmp(ctx.qry.page, "patch")) else if (!strcmp(ctx.qry.page, "patch"))
cgit_patch_link(name, title, class, ctx.qry.head, cgit_patch_link(name, title, class, ctx.qry.head,
ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL, ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
@ -503,7 +502,7 @@ void cgit_object_link(struct object *obj)
shortrev[10] = '\0'; shortrev[10] = '\0';
if (obj->type == OBJ_COMMIT) { if (obj->type == OBJ_COMMIT) {
cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL, cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL,
ctx.qry.head, fullrev, NULL, 0); ctx.qry.head, fullrev, NULL);
return; return;
} else if (obj->type == OBJ_TREE) } else if (obj->type == OBJ_TREE)
page = "tree"; page = "tree";
@ -875,7 +874,7 @@ void cgit_print_pageheader(void)
cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head, cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head,
ctx.qry.sha1, ctx.qry.vpath); ctx.qry.sha1, ctx.qry.vpath);
cgit_commit_link("commit", NULL, hc("commit"), cgit_commit_link("commit", NULL, hc("commit"),
ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath, 0); ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath);
cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head, cgit_diff_link("diff", NULL, hc("diff"), ctx.qry.head,
ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath, 0); ctx.qry.sha1, ctx.qry.sha2, ctx.qry.vpath, 0);
if (ctx.repo->max_stats) if (ctx.repo->max_stats)

Parādīt failu

@ -30,8 +30,7 @@ extern void cgit_log_link(const char *name, const char *title,
const char *pattern, int showmsg); const char *pattern, int showmsg);
extern void cgit_commit_link(char *name, const char *title, extern void cgit_commit_link(char *name, const char *title,
const char *class, const char *head, const char *class, const char *head,
const char *rev, const char *path, const char *rev, const char *path);
int toggle_ssdiff);
extern void cgit_patch_link(const char *name, const char *title, extern void cgit_patch_link(const char *name, const char *title,
const char *class, const char *head, const char *class, const char *head,
const char *rev, const char *path); const char *rev, const char *path);