Commit 4bd2a508fbb100052b42a5aa35d829514d69a0fb

Johan Abildskov 2018-08-20T13:51:28

Update giterr_last API documentation to reflect real behaviour

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/include/git2/errors.h b/include/git2/errors.h
index 00fbed1..5ae58bd 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -109,7 +109,12 @@ typedef enum {
 
 /**
  * Return the last `git_error` object that was generated for the
- * current thread or NULL if no error has occurred.
+ * current thread.
+ *
+ * The default behaviour of this function is to return NULL if no previous error has occurred.
+ * However, libgit2's error strings are not cleared aggressively, so a prior
+ * (unrelated) error may be returned. This can avoided by only calling
+ * this function if the prior call to a libgit2 API returned an error.
  *
  * @return A git_error object.
  */