stagit-gopher

[fork] gopher git frontend
Log | Files | Refs | README | LICENSE

commit 40f49c4d17d2cacc62c64e5f96522c3c14c40ab9
parent f939dd0767be55df7983178f51c85d3e55054056
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Thu,  6 Aug 2020 18:28:30 +0200

fix submodule lookup in bare repos

Sync fix from stagit.

Patch by kst <nil@krj.st>, thanks!

Diffstat:
Mstagit-gopher.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/stagit-gopher.c b/stagit-gopher.c @@ -1051,7 +1051,6 @@ int writefilestree(FILE *fp, git_tree *tree, const char *path) { const git_tree_entry *entry = NULL; - git_submodule *module = NULL; git_object *obj = NULL; git_off_t filesize; const char *entryname; @@ -1105,13 +1104,13 @@ writefilestree(FILE *fp, git_tree *tree, const char *path) gphlink(fp, filepath, strlen(filepath)); fputs("|server|port]\n", fp); git_object_free(obj); - } else if (!git_submodule_lookup(&module, repo, entryname)) { + } else if (git_tree_entry_type(entry) == GIT_OBJ_COMMIT) { + /* commit object in tree is a submodule */ fputs("[1|m--------- ", fp); utf8pad(buf, sizeof(buf), entrypath, 50, ' '); gphlink(fp, buf, strlen(buf)); fprintf(fp, "|%s/file/.gitmodules.gph|server|port]\n", relpath); /* NOTE: linecount omitted */ - git_submodule_free(module); } }