commit: fd84696f5ec4eeaeba5a1927df573358835123d7
parent 435821cb220e2ce62b78c89a1254de3bb5e9dd3d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 6 Jun 2024 07:07:00 +0200
stagit.c: Set filesize data-{value,type} for sorttable and title for humans
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/stagit.c b/stagit.c
@@ -1089,11 +1089,12 @@ writefilestree(FILE *fp, git_tree *tree, const char *path)
percentencode(fp, filepath, strlen(filepath));
fputs("\">", fp);
xmlencode(fp, entrypath, strlen(entrypath));
- fputs("</a></td><td class=\"num\" align=\"right\">", fp);
+ fputs("</a></td>", fp);
+ fprintf(fp, "<td class=\"num\" align=\"right\" data-value=\"%zu\" data-type=\"int\"", filesize);
if (lc > 0)
- fprintf(fp, "%zuL", lc);
+ fprintf(fp, "title=\"%zuB\">%zuL", filesize, lc);
else
- fprintf(fp, "%zuB", filesize);
+ fprintf(fp, ">%zuB", filesize);
fputs("</td></tr>\n", fp);
git_object_free(obj);
} else if (git_tree_entry_type(entry) == GIT_OBJ_COMMIT) {