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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-04-14 06:51:43 -07:00
parent 2f8f6c4fa1
commit f24cbbcb2c

View file

@ -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);