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>
This commit is contained in:
Dirk Hohndel 2017-10-26 13:40:21 +02:00
parent 6f20d1a208
commit 5269f8ce40

View file

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