summaryrefslogtreecommitdiff
path: root/include/git2/blob.h
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-05-14 11:03:30 -0700
committerVicent Martí <tanoku@gmail.com>2012-05-14 11:03:30 -0700
commite49cb1687e7400aeccac161a1b080fdc23897522 (patch)
tree08a78bdec6ff695713b1fb7cd2a0242a4c437373 /include/git2/blob.h
parent72bfde97908007ef28b6ab34dcece2aea90c8f53 (diff)
parentf0b350eb52866a88e762760d4d169beb60370fb0 (diff)
downloadlibgit2-e49cb1687e7400aeccac161a1b080fdc23897522.tar.gz
Merge pull request #671 from nulltoken/topic/blob_create_fromdisk
Add git_blob_create_fromdisk()
Diffstat (limited to 'include/git2/blob.h')
-rw-r--r--include/git2/blob.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h
index 44b29d7eb..afa350bb1 100644
--- a/include/git2/blob.h
+++ b/include/git2/blob.h
@@ -103,6 +103,18 @@ GIT_EXTERN(size_t) git_blob_rawsize(git_blob *blob);
*/
GIT_EXTERN(int) git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *path);
+/**
+ * Read a file from the filesystem and write its content
+ * to the Object Database as a loose blob
+ *
+ * @param oid return the id of the written blob
+ * @param repo repository where the blob will be written.
+ * this repository can be bare or not
+ * @param path file from which the blob will be created
+ * @return GIT_SUCCESS or an error code
+ */
+GIT_EXTERN(int) git_blob_create_fromdisk(git_oid *oid, git_repository *repo, const char *path);
+
/**
* Write an in-memory buffer to the ODB as a blob