summaryrefslogtreecommitdiff
path: root/include/git2/errors.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-11-05 14:56:10 +0100
committerVicent Marti <tanoku@gmail.com>2013-11-05 14:56:10 +0100
commit1eab9f0e32178a9aac941583c69e1b9cf9849f77 (patch)
tree7d1648b25f154516680397b4fb3941e50ef2c3b7 /include/git2/errors.h
parent3b259cbd1afdc96a3c3eb7af5895b310c1ac2a7d (diff)
downloadlibgit2-1eab9f0e32178a9aac941583c69e1b9cf9849f77.tar.gz
error: Simplify giterr_detach
Diffstat (limited to 'include/git2/errors.h')
-rw-r--r--include/git2/errors.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h
index 5f5d0ab1f..be7a31d8e 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -89,17 +89,14 @@ GIT_EXTERN(void) giterr_clear(void);
/**
* Get the last error data and clear it.
*
- * This copies the last error message into the given `git_buf` and returns
- * the associated `git_error_t`, leaving the error cleared as if
- * `giterr_clear` had been called. You must call `git_buf_free` on the
- * message to release the memory.
+ * This copies the last error into the given `git_error` struct
+ * and returns 0 if the copy was successful, leaving the error
+ * cleared as if `giterr_clear` had been called.
*
- * Note: it is possible that this will return `GITERR_NONE` and set the
- * buffer to NULL, so be prepared for that condition. Also, if the last
- * error was an out-of-memory error, this will return `GITERR_NOMEMORY`
- * but also leave the buffer set to NULL (to avoid allocation).
+ * If there was no existing error in the library, -1 will be returned
+ * and the contents of `cpy` will be left unmodified.
*/
-GIT_EXTERN(git_error_t) giterr_detach(git_buf *message);
+GIT_EXTERN(int) giterr_detach(git_error *cpy);
/**
* Set the error message string for this thread.