diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-11-29 13:36:36 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-11-30 22:45:13 -0500 |
| commit | fc1a3f456540dfc4dc143b322b943a4264658d56 (patch) | |
| tree | 3404931f494be61997af4fc9fe9034884169d73f /include/git2 | |
| parent | 6fdb1b2f55da9593576b096ee2eecce61995fb51 (diff) | |
| download | libgit2-fc1a3f456540dfc4dc143b322b943a4264658d56.tar.gz | |
object: return GIT_EINVALID on parse errors
Return `GIT_EINVALID` on parse errors so that direct callers of parse
functions can determine when there was a failure to parse the object.
The object parser functions will swallow this error code to prevent it
from propagating down the chain to end-users. (`git_merge` should not
return `GIT_EINVALID` when a commit it tries to look up is not valid,
this would be too vague to be useful.)
The only public function that this affects is
`git_signature_from_buffer`, which is now documented as returning
`GIT_EINVALID` when appropriate.
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/signature.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/git2/signature.h b/include/git2/signature.h index b14f3ea89..849998e66 100644 --- a/include/git2/signature.h +++ b/include/git2/signature.h @@ -71,7 +71,7 @@ GIT_EXTERN(int) git_signature_default(git_signature **out, git_repository *repo) * * @param out new signature * @param buf signature string - * @return 0 on success, or an error code + * @return 0 on success, GIT_EINVALID if the signature is not parseable, or an error code */ GIT_EXTERN(int) git_signature_from_buffer(git_signature **out, const char *buf); |
