From 52151038885c99a2ddf6b259e6c29601bd7051ef Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 7 Dec 2015 16:40:45 +0100 Subject: [PATCH] print file as table, add link --- urmoms.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/urmoms.c b/urmoms.c index 69f0d1f..d7e7005 100644 --- a/urmoms.c +++ b/urmoms.c @@ -503,11 +503,21 @@ writefiles(FILE *fp) git_repository_index(&index, repo); count = git_index_entrycount(index); + fputs("", fp); + for (i = 0; i < count; i++) { entry = git_index_get_byindex(index, i); - fprintf(fp, "name: %s, size: %" PRIu64 ", mode: %u\n", - entry->path, entry->file_size, entry->mode); + fputs("", fp); } + fputs("
ModeNameSize
", fp); + fprintf(fp, "%u", entry->mode); /* TODO: fancy print, like: "-rw-r--r--" */ + fprintf(fp, "path, strlen(entry->path)); + fputs("\">", fp); + xmlencode(fp, entry->path, strlen(entry->path)); + fputs("", fp); + fprintf(fp, "%" PRIu64, entry->file_size); + fputs("
", fp); return 0; } -- libgit2 1.1.1