From 5269f8ce4005c10064b613a42e40822582aa4826 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 26 Oct 2017 13:40:21 +0200 Subject: [PATCH] git storage: print the actual error It seems silly to not show what git told us went wrong. Signed-off-by: Dirk Hohndel --- core/save-git.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/save-git.c b/core/save-git.c index f0752f549..0f9da62f7 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -474,6 +474,12 @@ static int tree_insert(git_treebuilder *dir, const char *name, int mkunique, git } ret = git_treebuilder_insert(NULL, dir, name, id, mode); free_buffer(&uniquename); + if (ret) { + const git_error *gerr = giterr_last(); + if (gerr) { + fprintf(stderr, "tree_insert failed with return %d error %s\n", ret, gerr->message); + } + } return ret; }