From 95be399ab4692a77a818eb2d72e6b4b2e3d821ec Mon Sep 17 00:00:00 2001 From: lookshe Date: Mon, 1 Feb 2016 14:16:35 +0100 Subject: author link with correct branches --- ui-log.c | 2 +- ui-refs.c | 2 +- ui-shared.c | 8 ++++++-- ui-shared.h | 2 +- ui-stats.c | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ui-log.c b/ui-log.c index 014bf2e..babb2e3 100644 --- a/ui-log.c +++ b/ui-log.c @@ -237,7 +237,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) show_commit_decorations(commit); html(""); cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); - cgit_author_link(info->author); + cgit_author_link(info->author, NULL); cgit_close_filter(ctx.repo->email_filter); if (revs->graph) { diff --git a/ui-refs.c b/ui-refs.c index 14f4a5c..e066ed1 100644 --- a/ui-refs.c +++ b/ui-refs.c @@ -70,7 +70,7 @@ static int print_branch(struct refinfo *ref) cgit_commit_link(info->subject, NULL, NULL, name, NULL, NULL); html(""); cgit_open_filter(ctx.repo->email_filter, info->author_email, "refs"); - cgit_author_link(info->author); + cgit_author_link(info->author, name); cgit_close_filter(ctx.repo->email_filter); html(""); cgit_print_age(info->commit->date, -1, NULL); diff --git a/ui-shared.c b/ui-shared.c index 0c300be..8f8ee6c 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -1105,11 +1105,15 @@ void cgit_print_snapshot_links(const char *repo, const char *head, strbuf_release(&filename); } -extern void cgit_author_link(char *author) +extern void cgit_author_link(const char *author, const char *head) { char *delim; - delim = repolink(NULL, NULL, "log", NULL, NULL); + if (head) { + delim = repolink(NULL, NULL, "log", head, NULL); + } else { + delim = repolink(NULL, NULL, "log", ctx.qry.head, NULL); + } html(delim); htmlf("qt=author&q="); html_url_arg(author); diff --git a/ui-shared.h b/ui-shared.h index a82cd47..369e33c 100644 --- a/ui-shared.h +++ b/ui-shared.h @@ -75,5 +75,5 @@ extern void cgit_print_snapshot_links(const char *repo, const char *head, const char *hex, int snapshots); extern void cgit_add_hidden_formfields(int incl_head, int incl_search, const char *page); -extern void cgit_author_link(char *author); +extern void cgit_author_link(const char *author, const char *head); #endif /* UI_SHARED_H */ diff --git a/ui-stats.c b/ui-stats.c index 1042252..d2ddfd5 100644 --- a/ui-stats.c +++ b/ui-stats.c @@ -326,7 +326,7 @@ static void print_authors(struct string_list *authors, int top, for (i = 0; i < top; i++) { author = &authors->items[i]; html(""); - cgit_author_link(author->string); + cgit_author_link(author->string, NULL); html(""); authorstat = author->util; items = &authorstat->list; -- cgit v1.2.3