From 465d72a6d2795bb42d5e688dcb82af5169973483 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 3 Jan 2016 21:15:13 +0100 Subject: [PATCH] refs: dont make a table when there are no tags, add spacing between --- stagit.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/stagit.c b/stagit.c index 9d8efad..4b56829 100644 --- a/stagit.c +++ b/stagit.c @@ -881,17 +881,24 @@ writetags(FILE *fp) const git_oid *id = NULL; size_t i, len; - fputs("

Tags

\n" - "" - "" - "\n\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("

Tags

TagAgeCommit messageAuthorFiles+-
\n" + "" + "" + "\n\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("
", fp); return writetags(fp); } -- libgit2 1.1.1
TagAgeCommit messageAuthorFiles+-