summaryrefslogtreecommitdiffabout
path: root/ui-atom.c
authorLars Hjemli <hjemli@gmail.com>2009-07-25 09:40:25 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2009-07-25 09:41:06 (UTC)
commitfbe091a716447be496519ce439451d36d5b9fc24 (patch) (side-by-side diff)
treec6560c6f2ab6b4760ac6eaecda1759321da2746e /ui-atom.c
parente429fb0cca1e8c78da0ec38fe578bafdeec65534 (diff)
parent694dd43886f23723f415aed3afb62131cdbcaa51 (diff)
downloadcgit-fbe091a716447be496519ce439451d36d5b9fc24.zip
cgit-fbe091a716447be496519ce439451d36d5b9fc24.tar.gz
cgit-fbe091a716447be496519ce439451d36d5b9fc24.tar.bz2
Merge branch 'do/https'
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'ui-atom.c') (more/less context) (show whitespace changes)
-rw-r--r--ui-atom.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui-atom.c b/ui-atom.c
index a6ea3ee..e5c31d9 100644
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -31,49 +31,50 @@ void add_entry(struct commit *commit, char *host)
html("<name>");
html_txt(info->author);
html("</name>\n");
}
if (info->author_email) {
mail = xstrdup(info->author_email);
t = strchr(mail, '<');
if (t)
t++;
else
t = mail;
t2 = strchr(t, '>');
if (t2)
*t2 = '\0';
html("<email>");
html_txt(t);
html("</email>\n");
free(mail);
}
html("</author>\n");
html("<published>");
cgit_print_date(info->author_date, FMT_ATOMDATE, ctx.cfg.local_time);
html("</published>\n");
if (host) {
- html("<link rel='alternate' type='text/html' href='http://");
+ html("<link rel='alternate' type='text/html' href='");
+ html(cgit_httpscheme());
html_attr(host);
html_attr(cgit_pageurl(ctx.repo->url, "commit", NULL));
if (ctx.cfg.virtual_root)
delim = '?';
htmlf("%cid=%s", delim, hex);
html("'/>\n");
}
htmlf("<id>%s</id>\n", hex);
html("<content type='text'>\n");
html_txt(info->msg);
html("</content>\n");
html("<content type='xhtml'>\n");
html("<div xmlns='http://www.w3.org/1999/xhtml'>\n");
html("<pre>\n");
html_txt(info->msg);
html("</pre>\n");
html("</div>\n");
html("</content>\n");
html("</entry>\n");
cgit_free_commitinfo(info);
}
void cgit_print_atom(char *tip, char *path, int max_count)
@@ -92,38 +93,39 @@ void cgit_print_atom(char *tip, char *path, int max_count)
argv[argc++] = path;
}
init_revisions(&rev, NULL);
rev.abbrev = DEFAULT_ABBREV;
rev.commit_format = CMIT_FMT_DEFAULT;
rev.verbose_header = 1;
rev.show_root_diff = 0;
rev.max_count = max_count;
setup_revisions(argc, argv, &rev, NULL);
prepare_revision_walk(&rev);
host = cgit_hosturl();
ctx.page.mimetype = "text/xml";
ctx.page.charset = "utf-8";
cgit_print_http_headers(&ctx);
html("<feed xmlns='http://www.w3.org/2005/Atom'>\n");
html("<title>");
html_txt(ctx.repo->name);
html("</title>\n");
html("<subtitle>");
html_txt(ctx.repo->desc);
html("</subtitle>\n");
if (host) {
- html("<link rel='alternate' type='text/html' href='http://");
+ html("<link rel='alternate' type='text/html' href='");
+ html(cgit_httpscheme());
html_attr(host);
html_attr(cgit_repourl(ctx.repo->url));
html("'/>\n");
}
while ((commit = get_revision(&rev)) != NULL) {
add_entry(commit, host);
free(commit->buffer);
commit->buffer = NULL;
free_commit_list(commit->parents);
commit->parents = NULL;
}
html("</feed>\n");
}