Skip to content

Commit 346c1b1

Browse files
committed
docs: git_treebuilder_insert validates entries
The documentation for `git_treebuilder_insert` erroneously states that we do not validate that the entry being inserted exists. We do, as of libgit2#3633. Update the documentation to reflect the new reality.
1 parent d621024 commit 346c1b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/git2/tree.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,10 @@ GIT_EXTERN(const git_tree_entry *) git_treebuilder_get(
307307
* pointer may not be valid past the next operation in this
308308
* builder. Duplicate the entry if you want to keep it.
309309
*
310-
* No attempt is being made to ensure that the provided oid points
311-
* to an existing git object in the object database, nor that the
312-
* attributes make sense regarding the type of the pointed at object.
310+
* By default the entry that you are inserting will be checked for
311+
* validity; that it exists in the object database and is of the
312+
* correct type. If you do not want this behavior, set the
313+
* `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` library option to false.
313314
*
314315
* @param out Pointer to store the entry (optional)
315316
* @param bld Tree builder

0 commit comments

Comments
 (0)