From 375d41dcce94106460f1b3855ebb295ccb138593 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 29 Apr 2016 12:32:36 +0200 Subject: [PATCH] tweak style of showing submodules this will make it look similar to cgit. show mode as "m---------" --- stagit.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stagit.c b/stagit.c index 9e64069..7b16f32 100644 --- a/stagit.c +++ b/stagit.c @@ -654,7 +654,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path) { const git_tree_entry *entry = NULL; git_submodule *module = NULL; - const char *entryname; + const char *entryname, *moduleurl; char filepath[PATH_MAX], entrypath[PATH_MAX]; git_object *obj = NULL; git_off_t filesize; @@ -709,10 +709,12 @@ writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path) fprintf(fp, "%juB", (uintmax_t)filesize); fputs("\n", fp); } else if (git_submodule_lookup(&module, repo, entryname) == 0) { - - fprintf(fp, "@", - git_submodule_url(module)); + moduleurl = git_submodule_url(module); + fprintf(fp, "m---------", + moduleurl); xmlencode(fp, entrypath, strlen(entrypath)); + fputs(" @", fp); + xmlencode(fp, moduleurl, strlen(moduleurl)); fprintf(fp, "0%c", showlinecount ? 'L' : 'B'); git_submodule_free(module); -- libgit2 1.1.1