diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-03-07 03:02:55 +0400 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-03-07 03:11:43 +0400 |
commit | cb8a79617b15e347f26d21cedde0f2b8670c1876 (patch) | |
tree | 459706192f41bbf15496f0c9bfe2e21b16a7e70b /src/reflog.c | |
parent | 9d160ba85539bbc593369f597a07d42c2770dff4 (diff) |
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.
Diffstat (limited to 'src/reflog.c')
-rw-r--r-- | src/reflog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/reflog.c b/src/reflog.c index 8f68a3ac7..535276077 100644 --- a/src/reflog.c +++ b/src/reflog.c @@ -65,9 +65,9 @@ static int reflog_write(const char *log_path, const char *oid_old, git_buf_putc(&log, '\n'); - if ((error = git_buf_lasterror(&log)) < GIT_SUCCESS) { + if (git_buf_oom(&log)) { git_buf_free(&log); - return git__rethrow(error, "Failed to write reflog. Memory allocation failure"); + return git__throw(GIT_ENOMEM, "Failed to write reflog. Memory allocation failure"); } if ((error = git_filebuf_open(&fbuf, log_path, GIT_FILEBUF_APPEND)) < GIT_SUCCESS) { |