all repos — cgit @ eeddb5bc0905d4728001a111a9b1eb60ecccf9bd

a hyperfast web frontend for git written in c

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>
John Keeping john@keeping.me.uk
Sun, 05 Oct 2014 10:59:02 +0100
commit

eeddb5bc0905d4728001a111a9b1eb60ecccf9bd

parent

49f607777fe3d9393574a572d72caa568ee3ca3c

5 files changed, 11 insertions(+), 13 deletions(-)

jump to
M ui-commit.cui-commit.c

@@ -67,7 +67,7 @@ cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time);

html("</td></tr>\n"); html("<tr><th>commit</th><td colspan='2' class='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(" ("); cgit_patch_link("patch", NULL, NULL, NULL, tmp, prefix); html(")</td></tr>\n");

@@ -96,7 +96,7 @@ if (ctx.repo->enable_subject_links) {

parent_info = cgit_parse_commit(parent); 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(" ("); cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex, sha1_to_hex(p->item->object.sha1), prefix, 0);
M ui-log.cui-log.c

@@ -90,7 +90,7 @@ else {

strncpy(buf, deco->name, sizeof(buf) - 1); cgit_commit_link(buf, NULL, "deco", ctx.qry.head, sha1_to_hex(commit->object.sha1), - ctx.qry.vpath, 0); + ctx.qry.vpath); } next: deco = deco->next;

@@ -165,7 +165,7 @@ strcpy(info->subject + i, wrap_symbol);

} } 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); html("</td><td>"); cgit_open_filter(ctx.repo->email_filter, info->author_email, "log");
M ui-refs.cui-refs.c

@@ -67,7 +67,7 @@ ctx.qry.showmsg);

html("</td><td>"); 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>"); cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs"); html_txt(info->author);
M ui-shared.cui-shared.c

@@ -328,8 +328,7 @@ html("</a>");

} void cgit_commit_link(char *name, const char *title, const char *class, - const char *head, const char *rev, const char *path, - int toggle_ssdiff) + const char *head, const char *rev, const char *path) { if (strlen(name) > ctx.cfg.max_msg_len && ctx.cfg.max_msg_len >= 15) { name[ctx.cfg.max_msg_len] = '\0';

@@ -347,7 +346,7 @@ html("id=");

html_url_arg(rev); delim = "&amp;"; } - if ((ctx.qry.ssdiff && !toggle_ssdiff) || (!ctx.qry.ssdiff && toggle_ssdiff)) { + if (ctx.qry.ssdiff) { html(delim); html("ss=1"); delim = "&amp;";

@@ -463,7 +462,7 @@ ctx.qry.showmsg);

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, 0); + ctx.qry.path); else if (!strcmp(ctx.qry.page, "patch")) cgit_patch_link(name, title, class, ctx.qry.head, ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,

@@ -503,7 +502,7 @@ shortrev = xstrdup(fullrev);

shortrev[10] = '\0'; if (obj->type == OBJ_COMMIT) { cgit_commit_link(fmt("commit %s...", shortrev), NULL, NULL, - ctx.qry.head, fullrev, NULL, 0); + ctx.qry.head, fullrev, NULL); return; } else if (obj->type == OBJ_TREE) page = "tree";

@@ -875,7 +874,7 @@ ctx.qry.showmsg);

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, 0); + ctx.qry.head, ctx.qry.sha1, ctx.qry.vpath); 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)
M ui-shared.hui-shared.h

@@ -30,8 +30,7 @@ const char *path, int ofs, const char *grep,

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