Skip to content

Commit 4964aea

Browse files
authored
Merge pull request libgit2#4456 from libgit2/ethomson/treebuilder_docs
docs: git_treebuilder_insert validates entries
2 parents 98303ea + 346c1b1 commit 4964aea

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)