From cb8a79617b15e347f26d21cedde0f2b8670c1876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicent=20Mart=C3=AD?= Date: Wed, 7 Mar 2012 00:02:55 +0100 Subject: error-handling: Repository This also includes droping `git_buf_lasterror` because it makes no sense in the new system. Note that in most of the places were it has been dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so instead it should return a generic `-1` and obviously not throw anything. --- src/tag.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/tag.c') diff --git a/src/tag.c b/src/tag.c index 6076eb6e8..a5089e71c 100644 --- a/src/tag.c +++ b/src/tag.c @@ -193,10 +193,9 @@ static int write_tag_annotation( git_buf_putc(&tag, '\n'); git_buf_puts(&tag, message); - error = git_buf_lasterror(&tag); - if (error < GIT_SUCCESS) { + if (git_buf_oom(&tag)) { git_buf_free(&tag); - return git__rethrow(error, "Not enough memory to build the tag data"); + return git__throw(GIT_ENOMEM, "Not enough memory to build the tag data"); } error = git_repository_odb__weakptr(&odb, repo); -- cgit v1.2.1