garbash-stagit

garbash fork of stagit for git hosting with subdirs
git clone git://git.alexkarle.com.com/garbash-stagit
Log | Files | Refs | README | LICENSE

commit 465d72a6d2795bb42d5e688dcb82af5169973483 (patch)
parent e10f79ad2afa61294c90c4e9ae361aa2b086cf9d
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun,  3 Jan 2016 21:15:13 +0100

refs: dont make a table when there are no tags, add spacing between

Diffstat:
Mstagit.c | 20++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/stagit.c b/stagit.c @@ -881,17 +881,24 @@ writetags(FILE *fp) const git_oid *id = NULL; size_t i, len; - fputs("<h2>Tags</h2><table id=\"branches\"><thead>\n<tr><td>Tag</td>" - "<td>Age</td><td>Commit message</td>" - "<td>Author</td><td>Files</td><td class=\"num\">+</td>" - "<td class=\"num\">-</td></tr>\n</thead><tbody>\n", fp); - /* summary page with branches and tags */ memset(&tagnames, 0, sizeof(tagnames)); - git_tag_list(&tagnames, repo); + if (git_tag_list(&tagnames, repo)) + return -1; + if (!tagnames.count) { + git_strarray_free(&tagnames); + return 0; + } + /* sort names */ qsort(tagnames.strings, tagnames.count, sizeof(char *), (int (*)(const void *, const void *))&tagcompare); + + fputs("<h2>Tags</h2><table id=\"branches\"><thead>\n<tr><td>Tag</td>" + "<td>Age</td><td>Commit message</td>" + "<td>Author</td><td>Files</td><td class=\"num\">+</td>" + "<td class=\"num\">-</td></tr>\n</thead><tbody>\n", fp); + for (i = 0; i < tagnames.count; i++) { if (git_revparse_single(&obj, repo, tagnames.strings[i])) continue; @@ -946,6 +953,7 @@ writerefs(FILE *fp) if ((ret = writebranches(fp))) return ret; + fputs("<br/>", fp); return writetags(fp); }