commit d19946134d0e099d300e17f85ca3ed90203ef4d8
parent 66857e42479115af2beb4e0298ad1306b1b3b995
Author: mjkloeckner <martin.cachari@gmail.com>
Date: Wed, 4 Jan 2023 17:03:28 -0300
add dir-size selector
Diffstat:
M | stagit.c | | | 26 | ++++++++++++++++++-------- |
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/stagit.c b/stagit.c
@@ -1209,19 +1209,29 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
percentencode(fp, filepath, strlen(filepath));
fputs("\">", fp);
-
xmlencode(fp, entryname, strlen(entryname));
-
fputs("</a></td>", fp);
- fputs("<td id=\"file-size\" class=\"num\">", fp);
- fprintf(fp, "<a href=\"%s", relpath);
- percentencode(fp, filepath, strlen(filepath));
- fputs("\">", fp);
- if (lc > 0)
+ if (lc > 0) {
+ fputs("<td id=\"file-size\" class=\"num\">", fp);
+ fprintf(fp, "<a href=\"%s", relpath);
+ percentencode(fp, filepath, strlen(filepath));
+ fputs("\">", fp);
fprintf(fp, "%zuL", lc);
- else if (!is_obj_tree)
+ }
+ else if (!is_obj_tree) {
+ fputs("<td id=\"file-size\" class=\"num\">", fp);
+ fprintf(fp, "<a href=\"%s", relpath);
+ percentencode(fp, filepath, strlen(filepath));
+ fputs("\">", fp);
fprintf(fp, "%zuB", filesize);
+ }
+ else if (is_obj_tree) {
+ fputs("<td id=\"dir-size\">", fp);
+ fprintf(fp, "<a href=\"%s", relpath);
+ percentencode(fp, filepath, strlen(filepath));
+ fputs("\">.", fp);
+ }
fputs("</a></td></tr>\n", fp);
git_object_free(obj);