diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Emit `updated` on an empty atom feed
The feed-level element was written only inside the commit loop, so a feed with no commits omitted an element the atom format requires.
Diffstat (limited to 'source')
-rw-r--r--source/ui-atom.c7
1 file changed, 7 insertions, 0 deletions
diff --git a/source/ui-atom.c b/source/ui-atom.c
index 0659e96..3dc27c6 100644
--- a/source/ui-atom.c
+++ b/source/ui-atom.c
@@ -154,6 +154,13 @@ void cgit_print_atom(char *tip, const char *path, int max_count)
release_commit_memory(the_repository->parsed_objects, commit);
commit->parents = NULL;
}
+ if (first) {
+ /* An empty feed still needs one feed-level <updated>. */
+ html("<updated>");
+ html_txt(show_date(time(NULL), 0,
+ date_mode_from_type(DATE_ISO8601_STRICT)));
+ html("</updated>\n");
+ }
html("</feed>\n");
free(host);
}