diff options
author | Ben Straub <bstraub@github.com> | 2012-06-05 12:52:44 -0700 |
---|---|---|
committer | Ben Straub <bstraub@github.com> | 2012-06-05 12:52:44 -0700 |
commit | 56a5000d580ef5c9605bc9076610b5af9aa67518 (patch) | |
tree | 4026c8333991fbe221a17b5d16e5e4b52f66cb20 /include/git2/blob.h | |
parent | e267c9fc1a4910d1081e97b4d7a411658ddc0def (diff) | |
parent | 01dbe273c9b6f86a613b67cee27212cf4bacf4c0 (diff) | |
download | libgit2-56a5000d580ef5c9605bc9076610b5af9aa67518.tar.gz |
Merge branch 'development' into rev-parse
Conflicts:
src/util.h
tests-clar/refs/branches/listall.c
Diffstat (limited to 'include/git2/blob.h')
-rw-r--r-- | include/git2/blob.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h index 44b29d7eb..551770678 100644 --- a/include/git2/blob.h +++ b/include/git2/blob.h @@ -27,7 +27,7 @@ GIT_BEGIN_DECL * @param blob pointer to the looked up blob * @param repo the repo to use when locating the blob. * @param id identity of the blob to locate. - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ GIT_INLINE(int) git_blob_lookup(git_blob **blob, git_repository *repo, const git_oid *id) { @@ -44,7 +44,7 @@ GIT_INLINE(int) git_blob_lookup(git_blob **blob, git_repository *repo, const git * @param repo the repo to use when locating the blob. * @param id identity of the blob to locate. * @param len the length of the short identifier - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ GIT_INLINE(int) git_blob_lookup_prefix(git_blob **blob, git_repository *repo, const git_oid *id, unsigned int len) { @@ -99,10 +99,22 @@ GIT_EXTERN(size_t) git_blob_rawsize(git_blob *blob); * this repository cannot be bare * @param path file from which the blob will be created, * relative to the repository's working dir - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ 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 0 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 @@ -111,7 +123,7 @@ GIT_EXTERN(int) git_blob_create_fromfile(git_oid *oid, git_repository *repo, con * @param repo repository where to blob will be written * @param buffer data to be written into the blob * @param len length of the data - * @return GIT_SUCCESS or an error code + * @return 0 or an error code */ GIT_EXTERN(int) git_blob_create_frombuffer(git_oid *oid, git_repository *repo, const void *buffer, size_t len); |