diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-06-25 22:26:43 +0300 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2015-06-25 22:26:43 +0300 |
commit | 87987fd1e0f00a85c5fa16a96ca52decede629ae (patch) | |
tree | f6c7031ea2e936a5c73dd247d038d43a1b57780b /include | |
parent | daacf96d101b9d2100a5028090b5af5249d8893d (diff) | |
parent | 3cf91d98e28f2519e69c9ce77a6d6454adc713d7 (diff) |
Merge pull request #3246 from libgit2/cmn/dont-grow-borrowed
Don't allow growing borrowed buffers
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/blob.h | 10 | ||||
-rw-r--r-- | include/git2/errors.h | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h index c24ff7e7f..4a6d8e50a 100644 --- a/include/git2/blob.h +++ b/include/git2/blob.h @@ -107,12 +107,10 @@ GIT_EXTERN(git_off_t) git_blob_rawsize(const git_blob *blob); * The output is written into a `git_buf` which the caller must free * when done (via `git_buf_free`). * - * If no filters need to be applied, then the `out` buffer will just be - * populated with a pointer to the raw content of the blob. In that case, - * be careful to *not* free the blob until done with the buffer. To keep - * the data detached from the blob, call `git_buf_grow` on the buffer - * with a `want_size` of 0 and the buffer will be reallocated to be - * detached from the blob. + * If no filters need to be applied, then the `out` buffer will just + * be populated with a pointer to the raw content of the blob. In + * that case, be careful to *not* free the blob until done with the + * buffer or copy it into memory you own. * * @param out The git_buf to be filled in * @param blob Pointer to the blob diff --git a/include/git2/errors.h b/include/git2/errors.h index dda0f8a57..5ff0f35b5 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -46,6 +46,7 @@ typedef enum { GIT_EAPPLIED = -18, /**< Patch/merge has already been applied */ GIT_EPEEL = -19, /**< The requested peel operation is not possible */ GIT_EEOF = -20, /**< Unexpected EOF */ + GIT_EINVALID = -21, /**< Invalid operation or input */ GIT_PASSTHROUGH = -30, /**< Internal only */ GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */ |