stagit
Personal fork of stagit
git clone git://mccd.space/stagitcommit 51294e6f1272d834239b8c2b8ab78ec9f17e5604
parent bddf2ed060e8ced06117226b796556873de8080f
Author: Marc <marc@coquand.email>
Date: Thu, 23 Jul 2026 12:46:40 +0200
*
Diffstat:
1 file changed, 19 insertions(+), 0 deletions(-)
diff --git a/stagit.c b/stagit.c
@@ -66,6 +66,7 @@ static char *name = "";
static char *strippedname = "";
static char description[255];
static char contrib[1024];
+static char blobsurl[1024];
static char cloneurl[1024];
static char *submodules;
static char *licensefiles[] = { "HEAD:LICENSE", "HEAD:LICENSE.md", "HEAD:LICENSE.txt", "HEAD:COPYING" };
@@ -555,8 +556,13 @@ writeheader(FILE *fp, const char *title)
else xmlencode(fp, &contrib[ci], 1);
}
fputs("\">Mail</a>", fp);
+ }
+ if (blobsurl[0]) {
+ fprintf(fp, " | <a href=\"%s\">blobs</a>",
+ blobsurl);
}
+
fputs("</td></tr></tbody></table>", fp);
}
@@ -1325,6 +1331,19 @@ main(int argc, char *argv[])
checkfileerror(fpread, path, 'r');
fclose(fpread);
}
+
+ /* read blobs or .git/blobs */
+ joinpath(path, sizeof(path), repodir, "blobs");
+ if (!(fpread = fopen(path, "r"))) {
+ joinpath(path, sizeof(path), repodir, ".git/blobs");
+ fpread = fopen(path, "r");
+ }
+ if (fpread) {
+ if (!fgets(blobsurl, sizeof(blobsurl), fpread))
+ blobsurl[0] = '\0';
+ checkfileerror(fpread, path, 'r');
+ fclose(fpread);
+ }
/* read url or .git/url */