stagit

tweak style of showing submodules

this will make it look similar to cgit. show mode as "m---------"

Hiltjo Posthuma contact@arjunchoudhary.com

commit: afbd7ad parent: 857a915
1 files changed, 6 insertions(+), 4 deletions(-)
Mstagit.c+6-4
M · stagit.c +6, -4
 1@@ -654,7 +654,7 @@ writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path)
 2 {
 3 	const git_tree_entry *entry = NULL;
 4 	git_submodule *module = NULL;
 5-	const char *entryname;
 6+	const char *entryname, *moduleurl;
 7 	char filepath[PATH_MAX], entrypath[PATH_MAX];
 8 	git_object *obj = NULL;
 9 	git_off_t filesize;
10@@ -709,10 +709,12 @@ writefilestree(FILE *fp, git_tree *tree, const char *branch, const char *path)
11 				fprintf(fp, "%juB", (uintmax_t)filesize);
12 			fputs("</td></tr>\n", fp);
13 		} else if (git_submodule_lookup(&module, repo, entryname) == 0) {
14-
15-			fprintf(fp, "<tr><td></td><td><a class=\"module\" href=\"%s\">@",
16-				git_submodule_url(module));
17+			moduleurl = git_submodule_url(module);
18+			fprintf(fp, "<tr><td>m---------</td><td><a class=\"module\" href=\"%s\">",
19+				moduleurl);
20 			xmlencode(fp, entrypath, strlen(entrypath));
21+			fputs(" @", fp);
22+			xmlencode(fp, moduleurl, strlen(moduleurl));
23 			fprintf(fp, "</a></td><td class=\"num\">0%c",
24 				showlinecount ? 'L' : 'B');
25 			git_submodule_free(module);