aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.c
diff options
context:
space:
mode:
authorLars Hjemli2006-12-11 16:55:07 +0100
committerLars Hjemli2006-12-11 16:55:33 +0100
commit1418034e642fee67c981b31e4c3eb6e8ae14e303 (patch)
tree3addc880197706f2ddd24f35c5d886f1e885b276 /cgit.c
parent74620f12e4f7e91cb0a0b4ca731e07272d1b65f6 (diff)
downloadcgit-1418034e642fee67c981b31e4c3eb6e8ae14e303.tar.gz
cgit-1418034e642fee67c981b31e4c3eb6e8ae14e303.tar.bz2
cgit-1418034e642fee67c981b31e4c3eb6e8ae14e303.zip
Move repo summary functions into ui-summary.c
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/cgit.c b/cgit.c
index b3ff512..300fe46 100644
--- a/cgit.c
+++ b/cgit.c
@@ -84,44 +84,6 @@ void cgit_querystring_cb(const char *name, const char *value)
84 } 84 }
85} 85}
86 86
87static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1,
88 int flags, void *cb_data)
89{
90 struct commit *commit;
91 char buf[256], *url;
92
93 commit = lookup_commit(sha1);
94 if (commit && !parse_commit(commit)){
95 html("<tr><td>");
96 url = cgit_pageurl(cgit_query_repo, "log",
97 fmt("h=%s", refname));
98 html_link_open(url, NULL, NULL);
99 strncpy(buf, refname, sizeof(buf));
100 html_txt(buf);
101 html_link_close();
102 html("</td><td>");
103 pretty_print_commit(CMIT_FMT_ONELINE, commit, ~0, buf,
104 sizeof(buf), 0, NULL, NULL, 0);
105 html_txt(buf);
106 html("</td></tr>\n");
107 } else {
108 html("<tr><td>");
109 html_txt(buf);
110 html("</td><td>");
111 htmlf("*** bad ref %s", sha1_to_hex(sha1));
112 html("</td></tr>\n");
113 }
114 return 0;
115}
116
117static void cgit_print_branches()
118{
119 html("<table class='list'>");
120 html("<tr><th>Branch name</th><th>Head commit</th></tr>\n");
121 for_each_branch_ref(cgit_print_branch_cb, NULL);
122 html("</table>");
123}
124
125static int get_one_line(char *txt) 87static int get_one_line(char *txt)
126{ 88{
127 char *t; 89 char *t;
@@ -227,14 +189,6 @@ static void cgit_print_log(const char *tip, int ofs, int cnt)
227 html("</table>\n"); 189 html("</table>\n");
228} 190}
229 191
230static void cgit_print_repo_summary()
231{
232 html("<h2>");
233 html_txt("Repo summary page");
234 html("</h2>");
235 cgit_print_branches();
236}
237
238static void cgit_print_object(char *hex) 192static void cgit_print_object(char *hex)
239{ 193{
240 unsigned char sha1[20]; 194 unsigned char sha1[20];