summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--ui-commit.c15
-rw-r--r--ui-log.c4
-rw-r--r--ui-summary.c8
3 files changed, 17 insertions, 10 deletions
diff --git a/ui-commit.c b/ui-commit.c
index f654208..8916212 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -15,4 +15,4 @@ void cgit_print_commit(const char *hex)
struct commit_list *p;
-
unsigned char sha1[20];
+ char *query;
@@ -22,3 +22,2 @@ void cgit_print_commit(const char *hex)
}
-
commit = lookup_commit_reference(sha1);
@@ -28,3 +27,2 @@ void cgit_print_commit(const char *hex)
}
-
info = cgit_parse_commit(commit);
@@ -47,8 +45,11 @@ void cgit_print_commit(const char *hex)
html("<tr><th>tree</th><td colspan='2' class='sha1'><a href='");
- html_attr(cgit_pageurl(cgit_query_repo, "tree", fmt("id=%s", sha1_to_hex(commit->tree->object.sha1))));
+ query = fmt("id=%s", sha1_to_hex(commit->tree->object.sha1));
+ html_attr(cgit_pageurl(cgit_query_repo, "tree", query));
htmlf("'>%s</a></td></tr>\n", sha1_to_hex(commit->tree->object.sha1));
-
for (p = commit->parents; p ; p = p->next) {
- html("<tr><th>parent</th><td colspan='2' class='sha1'><a href='");
- html_attr(cgit_pageurl(cgit_query_repo, "commit", fmt("id=%s", sha1_to_hex(p->item->object.sha1))));
+ html("<tr><th>parent</th>"
+ "<td colspan='2' class='sha1'>"
+ "<a href='");
+ query = fmt("id=%s", sha1_to_hex(p->item->object.sha1));
+ html_attr(cgit_pageurl(cgit_query_repo, "commit", query));
htmlf("'>%s</a></td></tr>\n",
diff --git a/ui-log.c b/ui-log.c
index b7da49f..def96f6 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -51,3 +51,5 @@ void cgit_print_log(const char *tip, int ofs, int cnt)
html("<table class='list log'>");
- html("<tr><th class='left'>Date</th><th class='left'>Message</th><th class='left'>Author</th></tr>\n");
+ html("<tr><th class='left'>Date</th>"
+ "<th class='left'>Message</th>"
+ "<th class='left'>Author</th></tr>\n");
diff --git a/ui-summary.c b/ui-summary.c
index 5ddeee3..638c8f6 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -30,3 +30,4 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1,
html("</td><td>");
- url = cgit_pageurl(cgit_query_repo, "commit", fmt("id=%s", sha1_to_hex(sha1)));
+ url = cgit_pageurl(cgit_query_repo, "commit",
+ fmt("id=%s", sha1_to_hex(sha1)));
html_link_open(url, NULL, NULL);
@@ -51,3 +52,6 @@ static void cgit_print_branches()
html("<table class='list'>");
- html("<tr><th class='left'>Branch</th><th class='left'>Updated</th><th class='left'>Commit subject</th><th class='left'>Author</th></tr>\n");
+ html("<tr><th class='left'>Branch</th>"
+ "<th class='left'>Updated</th>"
+ "<th class='left'>Commit subject</th>"
+ "<th class='left'>Author</th></tr>\n");
for_each_branch_ref(cgit_print_branch_cb, NULL);