summaryrefslogtreecommitdiffstats
path: root/core/save-git.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-26 13:40:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-26 20:44:02 +0200
commit5269f8ce4005c10064b613a42e40822582aa4826 (patch)
tree27dd74fa2e5fcfcd60429cc7c279c9e927aa4ca4 /core/save-git.c
parent6f20d1a2081d7b22da215d0aab293124b5ef9582 (diff)
downloadsubsurface-5269f8ce4005c10064b613a42e40822582aa4826.tar.gz
git storage: print the actual error
It seems silly to not show what git told us went wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/save-git.c')
-rw-r--r--core/save-git.c6
1 files changed, 6 insertions, 0 deletions
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;
}