Skip to content

Commit 4bd2a50

Browse files
committed
Update giterr_last API documentation to reflect real behaviour
1 parent 73e31f6 commit 4bd2a50

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

include/git2/errors.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ typedef enum {
109109

110110
/**
111111
* Return the last `git_error` object that was generated for the
112-
* current thread or NULL if no error has occurred.
112+
* current thread.
113+
*
114+
* The default behaviour of this function is to return NULL if no previous error has occurred.
115+
* However, libgit2's error strings are not cleared aggressively, so a prior
116+
* (unrelated) error may be returned. This can avoided by only calling
117+
* this function if the prior call to a libgit2 API returned an error.
113118
*
114119
* @return A git_error object.
115120
*/

0 commit comments

Comments
 (0)