diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2019-06-08 17:46:04 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-06-16 00:16:49 +0100 |
| commit | 08f392080cfd7e08972820d8147dc06432e7c4bf (patch) | |
| tree | 14fe06510232924fc5e164d979a32980216104a0 /src/blob.c | |
| parent | 5d92e54745eaad2c89aa6457d504411ceee3a4f4 (diff) | |
| download | libgit2-08f392080cfd7e08972820d8147dc06432e7c4bf.tar.gz | |
blob: add underscore to `from` functions
The majority of functions are named `from_something` (with an
underscore) instead of `fromsomething`. Update the blob functions for
consistency with the rest of the library.
Diffstat (limited to 'src/blob.c')
| -rw-r--r-- | src/blob.c | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/src/blob.c b/src/blob.c index 566d24b8e..31e6ccf86 100644 --- a/src/blob.c +++ b/src/blob.c @@ -70,7 +70,7 @@ int git_blob__parse(void *_blob, git_odb_object *odb_obj) return 0; } -int git_blob_create_frombuffer( +int git_blob_create_from_buffer( git_oid *id, git_repository *repo, const void *buffer, size_t len) { int error; @@ -263,13 +263,13 @@ done: return error; } -int git_blob_create_fromworkdir( +int git_blob_create_from_workdir( git_oid *id, git_repository *repo, const char *path) { return git_blob__create_from_paths(id, NULL, repo, NULL, path, 0, true); } -int git_blob_create_fromdisk( +int git_blob_create_from_disk( git_oid *id, git_repository *repo, const char *path) { int error; @@ -325,7 +325,7 @@ static int blob_writestream_write(git_writestream *_stream, const char *buffer, return git_filebuf_write(&stream->fbuf, buffer, len); } -int git_blob_create_fromstream(git_writestream **out, git_repository *repo, const char *hintpath) +int git_blob_create_from_stream(git_writestream **out, git_repository *repo, const char *hintpath) { int error; git_buf path = GIT_BUF_INIT; @@ -364,7 +364,7 @@ cleanup: return error; } -int git_blob_create_fromstream_commit(git_oid *out, git_writestream *_stream) +int git_blob_create_from_stream_commit(git_oid *out, git_writestream *_stream) { int error; blob_writestream *stream = (blob_writestream *) _stream; @@ -427,3 +427,36 @@ int git_blob_filtered_content( return error; } + +/* Deprecated functions */ + +int git_blob_create_frombuffer( + git_oid *id, git_repository *repo, const void *buffer, size_t len) +{ + return git_blob_create_from_buffer(id, repo, buffer, len); +} + +int git_blob_create_fromworkdir(git_oid *id, git_repository *repo, const char *relative_path) +{ + return git_blob_create_from_workdir(id, repo, relative_path); +} + +int git_blob_create_fromdisk(git_oid *id, git_repository *repo, const char *path) +{ + return git_blob_create_from_disk(id, repo, path); +} + +int git_blob_create_fromstream( + git_writestream **out, + git_repository *repo, + const char *hintpath) +{ + return git_blob_create_from_stream(out, repo, hintpath); +} + +int git_blob_create_fromstream_commit( + git_oid *out, + git_writestream *stream) +{ + return git_blob_create_from_stream_commit(out, stream); +} |
