From f24cbbcb2cf49ff52aa3c51090b77b60ec1cfc08 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 14 Apr 2020 06:51:43 -0700 Subject: git-storage: add additional debug output This helps the user figure out why we weren't able to write a tree. Signed-off-by: Dirk Hohndel --- core/save-git.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/save-git.c b/core/save-git.c index 2d58f931a..6f1cc4646 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -1196,6 +1196,11 @@ static int write_git_tree(git_repository *repo, struct dir *tree, git_oid *resul /* .. write out the resulting treebuilder */ ret = git_treebuilder_write(result, tree->files); + if (ret && verbose) { + const git_error *gerr = giterr_last(); + if (gerr) + fprintf(stderr, "tree_insert failed with return %d error %s\n", ret, gerr->message); + } /* .. and free the now useless treebuilder */ git_treebuilder_free(tree->files); -- cgit v1.2.3-70-g09d2