summaryrefslogtreecommitdiff
path: root/src/git/blob.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/git/blob.h')
-rw-r--r--src/git/blob.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/git/blob.h b/src/git/blob.h
index 23afd64a9..93ced42ee 100644
--- a/src/git/blob.h
+++ b/src/git/blob.h
@@ -63,18 +63,17 @@ GIT_EXTERN(int) git_blob_set_rawcontent_fromfile(git_blob *blob, const char *fil
GIT_EXTERN(int) git_blob_set_rawcontent(git_blob *blob, const void *buffer, size_t len);
/**
- * Read the raw content of a blob.
+ * Get a read-only buffer with the raw content of a blob.
*
- * A copy of the raw content is stored on the buffer passed
- * to the function. If the buffer is not long enough,
- * the method will fail.
+ * A pointer to the raw content of a blob is returned;
+ * this pointer is owned internally by the object and shall
+ * not be free'd. The pointer may be invalidated at a later
+ * time (e.g. when changing the contents of the blob).
*
* @param blob pointer to the blob
- * @param buffer buffer to fill with contents
- * @param len size of the buffer
- * @return 0 on success; error code otherwise
+ * @return the pointer; NULL if the blob has no contents
*/
-GIT_EXTERN(int) git_blob_rawcontent(git_blob *blob, void *buffer, size_t len);
+GIT_EXTERN(const char *) git_blob_rawcontent(git_blob *blob);
/**
* Get the size in bytes of the contents of a blob