diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-02-28 00:20:28 +0000 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-03-04 09:30:21 +0000 |
| commit | 7eb21516ad9a1bd8e7e7b16198e0a4eda299e87d (patch) | |
| tree | 01d92c0152b1ae208265a569907495b016decb09 /include/git2 | |
| parent | 0fb58396835f789b3c662184003ff34cbf98d248 (diff) | |
| download | libgit2-7eb21516ad9a1bd8e7e7b16198e0a4eda299e87d.tar.gz | |
tree: deprecate `git_treebuilder_write_with_buffer`
The function `git_treebuilder_write_with_buffer` is unnecessary; it
is used internally as part of treebuilder writing, but it has little
use to external callers. For callers that repeatedly write a
treebuilder, we can supply them with a buffer in the treebuilder struct
instead of recreating it. For ourselves, when we want a single buffer
in our write loop, we can use an internal function.
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/deprecated.h | 27 | ||||
| -rw-r--r-- | include/git2/tree.h | 14 |
2 files changed, 27 insertions, 14 deletions
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h index d18fffc0e..37857f8a2 100644 --- a/include/git2/deprecated.h +++ b/include/git2/deprecated.h @@ -119,6 +119,33 @@ GIT_EXTERN(int) git_blob_filtered_content( /**@}*/ +/** @name Deprecated Tree Functions + * + * These functions are retained for backward compatibility. The + * newer versions of these functions and values should be preferred + * in all new code. + * + * There is no plan to remove these backward compatibility values at + * this time. + */ +/**@{*/ + +/** + * Write the contents of the tree builder as a tree object. + * This is an alias of `git_treebuilder_write` and is preserved + * for backward compatibility. + * + * This function is deprecated, but there is no plan to remove this + * function at this time. + * + * @deprecated Use git_treebuilder_write + * @see git_treebuilder_write + */ +GIT_EXTERN(int) git_treebuilder_write_with_buffer( + git_oid *oid, git_treebuilder *bld, git_buf *tree); + +/**@}*/ + /** @name Deprecated Buffer Functions * * These functions and enumeration values are retained for backward diff --git a/include/git2/tree.h b/include/git2/tree.h index 1a8e155fc..d7545ace9 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -378,20 +378,6 @@ GIT_EXTERN(int) git_treebuilder_filter( GIT_EXTERN(int) git_treebuilder_write( git_oid *id, git_treebuilder *bld); -/** - * Write the contents of the tree builder as a tree object - * using a shared git_buf. - * - * @see git_treebuilder_write - * - * @param oid Pointer to store the OID of the newly written tree - * @param bld Tree builder to write - * @param tree Shared buffer for writing the tree. Will be grown as necessary. - * @return 0 or an error code - */ -GIT_EXTERN(int) git_treebuilder_write_with_buffer( - git_oid *oid, git_treebuilder *bld, git_buf *tree); - /** Callback for the tree traversal method */ typedef int GIT_CALLBACK(git_treewalk_cb)( const char *root, const git_tree_entry *entry, void *payload); |
