summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ui-summary.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui-summary.c b/ui-summary.c
index b4bc6d8..fdee66b 100644
--- a/ui-summary.c
+++ b/ui-summary.c
@@ -15,97 +15,97 @@ static int cgit_print_branch_cb(const char *refname, const unsigned char *sha1,
15{ 15{
16 struct commit *commit; 16 struct commit *commit;
17 struct commitinfo *info; 17 struct commitinfo *info;
18 char buf[256]; 18 char buf[256];
19 char *ref; 19 char *ref;
20 20
21 ref = xstrdup(refname); 21 ref = xstrdup(refname);
22 strncpy(buf, refname, sizeof(buf)); 22 strncpy(buf, refname, sizeof(buf));
23 commit = lookup_commit(sha1); 23 commit = lookup_commit(sha1);
24 // object is not really parsed at this point, because of some fallout 24 // object is not really parsed at this point, because of some fallout
25 // from previous calls to git functions in cgit_print_log() 25 // from previous calls to git functions in cgit_print_log()
26 commit->object.parsed = 0; 26 commit->object.parsed = 0;
27 if (commit && !parse_commit(commit)){ 27 if (commit && !parse_commit(commit)){
28 info = cgit_parse_commit(commit); 28 info = cgit_parse_commit(commit);
29 html("<tr><td>"); 29 html("<tr><td>");
30 cgit_log_link(ref, NULL, NULL, ref, NULL, NULL, 0); 30 cgit_log_link(ref, NULL, NULL, ref, NULL, NULL, 0);
31 html("</td><td>"); 31 html("</td><td>");
32 cgit_print_age(commit->date, -1, NULL); 32 cgit_print_age(commit->date, -1, NULL);
33 html("</td><td>"); 33 html("</td><td>");
34 html_txt(info->author); 34 html_txt(info->author);
35 html("</td><td>"); 35 html("</td><td>");
36 cgit_commit_link(info->subject, NULL, NULL, ref, NULL); 36 cgit_commit_link(info->subject, NULL, NULL, ref, NULL);
37 html("</td></tr>\n"); 37 html("</td></tr>\n");
38 cgit_free_commitinfo(info); 38 cgit_free_commitinfo(info);
39 } else { 39 } else {
40 html("<tr><td>"); 40 html("<tr><td>");
41 html_txt(buf); 41 html_txt(buf);
42 html("</td><td colspan='3'>"); 42 html("</td><td colspan='3'>");
43 htmlf("*** bad ref %s ***", sha1_to_hex(sha1)); 43 htmlf("*** bad ref %s ***", sha1_to_hex(sha1));
44 html("</td></tr>\n"); 44 html("</td></tr>\n");
45 } 45 }
46 free(ref); 46 free(ref);
47 return 0; 47 return 0;
48} 48}
49 49
50 50
51static void cgit_print_object_ref(struct object *obj) 51static void cgit_print_object_ref(struct object *obj)
52{ 52{
53 char *page, *arg, *url; 53 char *page, *arg, *url;
54 54
55 if (obj->type == OBJ_COMMIT) { 55 if (obj->type == OBJ_COMMIT) {
56 cgit_commit_link(fmt("commit %s", sha1_to_hex(obj->sha1)), NULL, NULL, 56 cgit_commit_link(fmt("commit %s", sha1_to_hex(obj->sha1)), NULL, NULL,
57 cgit_query_head, sha1_to_hex(obj->sha1)); 57 cgit_query_head, sha1_to_hex(obj->sha1));
58 return; 58 return;
59 } else if (obj->type == OBJ_TREE) { 59 } else if (obj->type == OBJ_TREE) {
60 page = "tree"; 60 page = "tree";
61 arg = "id"; 61 arg = "id";
62 } else { 62 } else {
63 page = "view"; 63 page = "blob";
64 arg = "id"; 64 arg = "id";
65 } 65 }
66 66
67 url = cgit_pageurl(cgit_query_repo, page, 67 url = cgit_pageurl(cgit_query_repo, page,
68 fmt("%s=%s", arg, sha1_to_hex(obj->sha1))); 68 fmt("%s=%s", arg, sha1_to_hex(obj->sha1)));
69 html_link_open(url, NULL, NULL); 69 html_link_open(url, NULL, NULL);
70 htmlf("%s %s", typename(obj->type), 70 htmlf("%s %s", typename(obj->type),
71 sha1_to_hex(obj->sha1)); 71 sha1_to_hex(obj->sha1));
72 html_link_close(); 72 html_link_close();
73} 73}
74 74
75static void print_tag_header() 75static void print_tag_header()
76{ 76{
77 html("<tr class='nohover'><th class='left'>Tag</th>" 77 html("<tr class='nohover'><th class='left'>Tag</th>"
78 "<th class='left'>Age</th>" 78 "<th class='left'>Age</th>"
79 "<th class='left'>Author</th>" 79 "<th class='left'>Author</th>"
80 "<th class='left'>Reference</th></tr>\n"); 80 "<th class='left'>Reference</th></tr>\n");
81 header = 1; 81 header = 1;
82} 82}
83 83
84static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1, 84static int cgit_print_tag_cb(const char *refname, const unsigned char *sha1,
85 int flags, void *cb_data) 85 int flags, void *cb_data)
86{ 86{
87 struct tag *tag; 87 struct tag *tag;
88 struct taginfo *info; 88 struct taginfo *info;
89 struct object *obj; 89 struct object *obj;
90 char buf[256], *url; 90 char buf[256], *url;
91 91
92 strncpy(buf, refname, sizeof(buf)); 92 strncpy(buf, refname, sizeof(buf));
93 obj = parse_object(sha1); 93 obj = parse_object(sha1);
94 if (!obj) 94 if (!obj)
95 return 1; 95 return 1;
96 if (obj->type == OBJ_TAG) { 96 if (obj->type == OBJ_TAG) {
97 tag = lookup_tag(sha1); 97 tag = lookup_tag(sha1);
98 if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) 98 if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag)))
99 return 2; 99 return 2;
100 if (!header) 100 if (!header)
101 print_tag_header(); 101 print_tag_header();
102 html("<tr><td>"); 102 html("<tr><td>");
103 url = cgit_pageurl(cgit_query_repo, "view", 103 url = cgit_pageurl(cgit_query_repo, "view",
104 fmt("id=%s", sha1_to_hex(sha1))); 104 fmt("id=%s", sha1_to_hex(sha1)));
105 html_link_open(url, NULL, NULL); 105 html_link_open(url, NULL, NULL);
106 html_txt(buf); 106 html_txt(buf);
107 html_link_close(); 107 html_link_close();
108 html("</td><td>"); 108 html("</td><td>");
109 if (info->tagger_date > 0) 109 if (info->tagger_date > 0)
110 cgit_print_age(info->tagger_date, -1, NULL); 110 cgit_print_age(info->tagger_date, -1, NULL);
111 html("</td><td>"); 111 html("</td><td>");