diff options
| author | Vicent Martà <vicent@github.com> | 2013-05-09 06:48:16 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2013-05-09 06:48:16 -0700 |
| commit | 9ca4ff41eb4fae26b9336d440953bc6be752f832 (patch) | |
| tree | 70715be871f0845757c58abe674109d9ec6d0a4d /include | |
| parent | 503dd0f3c4f798b02e0173dde7e3631d6e860c42 (diff) | |
| parent | 3d1c9f612d78c6c235a3f38af226300fb6dd7dd6 (diff) | |
| download | libgit2-9ca4ff41eb4fae26b9336d440953bc6be752f832.tar.gz | |
Merge pull request #1563 from arrbee/doc-fix-repo-message
Fix git_repository_message docs
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/repository.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h index cd238e17c..e0464c63f 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -460,10 +460,19 @@ GIT_EXTERN(int) git_repository_index(git_index **out, git_repository *repo); * Use this function to get the contents of this file. Don't forget to * remove the file after you create the commit. * + * If the repository message exists and there are no errors reading it, this + * returns the bytes needed to store the message in memory (i.e. message + * file size plus one terminating NUL byte). That value is returned even if + * `out` is NULL or `len` is shorter than the necessary size. + * + * The `out` buffer will *always* be NUL terminated, even if truncation + * occurs. + * * @param out Buffer to write data into or NULL to just read required size - * @param len Length of buffer in bytes + * @param len Length of `out` buffer in bytes * @param repo Repository to read prepared message from - * @return Bytes written to buffer, GIT_ENOTFOUND if no message, or -1 on error + * @return GIT_ENOUTFOUND if no message exists, other value < 0 for other + * errors, or total bytes in message (may be > `len`) on success */ GIT_EXTERN(int) git_repository_message(char *out, size_t len, git_repository *repo); |
