summaryrefslogtreecommitdiff
path: root/include/git2/blob.h
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-05-06 21:00:20 +0200
committernulltoken <emeric.fermas@gmail.com>2012-05-13 11:28:49 +0200
commit6ca9643c967cb2de89ba360eb226ec49d27345a4 (patch)
tree4bbd3f42863be71000333585e68b220a990ba80b /include/git2/blob.h
parentb72969e0643cb561b42aceec4d1a18ce9c782c09 (diff)
downloadlibgit2-6ca9643c967cb2de89ba360eb226ec49d27345a4.tar.gz
blob: Add git_blob_create_fromdisk()
This function will create blobs in the object database from files anywhere on the filesystem. This can be run against bare and non-bare repositories.
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