Commit b8323775 by Carlos Martín Nieto

blob: don't recomment using git_buf_grow

We currently recommend using `git_buf_grow` in order to make a buffer
make an owned copy of the memory it points to. This is not behaviour we
should encourage, so remove this recommendation.

The function itself is not changed, as we need to remain compatible, but
it will be changed not to allow usage on borrowed buffers.
parent a7e7bcd8
...@@ -107,12 +107,10 @@ GIT_EXTERN(git_off_t) git_blob_rawsize(const git_blob *blob); ...@@ -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 * The output is written into a `git_buf` which the caller must free
* when done (via `git_buf_free`). * when done (via `git_buf_free`).
* *
* If no filters need to be applied, then the `out` buffer will just be * If no filters need to be applied, then the `out` buffer will just
* populated with a pointer to the raw content of the blob. In that case, * be populated with a pointer to the raw content of the blob. In
* be careful to *not* free the blob until done with the buffer. To keep * that case, be careful to *not* free the blob until done with the
* the data detached from the blob, call `git_buf_grow` on the buffer * buffer or copy it into memory you own.
* with a `want_size` of 0 and the buffer will be reallocated to be
* detached from the blob.
* *
* @param out The git_buf to be filled in * @param out The git_buf to be filled in
* @param blob Pointer to the blob * @param blob Pointer to the blob
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment