tstagit.c: only link to tarballs for master branch and tags - stagit - [fork] customized build of stagit, the static git page generator
 (HTM) git clone git://src.adamsgaard.dk/stagit
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 02b67e7268ee2cb11a0fe254a832f7e6f0dcf85d
 (DIR) parent 9bed6322e863501bc279ac700275527b7ddbd02e
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Mon, 23 Nov 2020 20:56:30 +0100
       
       stagit.c: only link to tarballs for master branch and tags
       
       Diffstat:
         M stagit.c                            |      10 +++++++---
       
       1 file changed, 7 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/stagit.c b/stagit.c
       t@@ -1101,10 +1101,14 @@ writerefs(FILE *fp)
                        s = git_reference_shorthand(ris[i].ref);
        
                        fputs("<tr><td>", fp);
       -                fprintf(fp, "<a href=\"%s/%s/%s-%s.tar.gz\">",
       -                        releasedir, strippedname, strippedname, s);
       +                if (strncmp(s, "master", strlen(s)) == 0 ||
       +                    strncmp(ids[j], "tags", strlen(ids[j])) == 0)
       +                        fprintf(fp, "<a href=\"%s/%s/%s-%s.tar.gz\">",
       +                                        releasedir, strippedname, strippedname, s);
                        xmlencode(fp, s, strlen(s));
       -                fputs("</a>", fp);
       +                if (strncmp(s, "master", strlen(s)) == 0 ||
       +                    strncmp(ids[j], "tags", strlen(ids[j])) == 0)
       +                        fputs("</a>", fp);
                        fputs("</td><td>", fp);
                        if (ci->author)
                                printtimeshort(fp, &(ci->author->when));