summaryrefslogtreecommitdiff
path: root/include/git2/tree.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-06-09 22:45:23 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-06-10 15:14:13 +0200
commit978fbb4c345e944004e5a2aede17cdd17ab75356 (patch)
tree6dd372da3af53f313cf20ffa0f5957dc5a572fd6 /include/git2/tree.h
parent4d3f1f97404b01cd00ad5b2f47f64672d787e901 (diff)
downloadlibgit2-978fbb4c345e944004e5a2aede17cdd17ab75356.tar.gz
treebuilder: don't keep removed entries around
If the user wants to keep a copy for themselves, they should make a copy. It adds unnecessary complexity to make sure the returned entries are valid until the builder is cleared.
Diffstat (limited to 'include/git2/tree.h')
-rw-r--r--include/git2/tree.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h
index 8f1d8a089..42b68193e 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -301,8 +301,10 @@ GIT_EXTERN(const git_tree_entry *) git_treebuilder_get(
* If an entry named `filename` already exists, its attributes
* will be updated with the given ones.
*
- * The optional pointer `out` can be used to retrieve a pointer to
- * the newly created/updated entry. Pass NULL if you do not need it.
+ * The optional pointer `out` can be used to retrieve a pointer to the
+ * newly created/updated entry. Pass NULL if you do not need it. The
+ * pointer may not be valid past the next operation in this
+ * builder. Duplicate the entry if you want to keep it.
*
* No attempt is being made to ensure that the provided oid points
* to an existing git object in the object database, nor that the
@@ -354,7 +356,7 @@ typedef int (*git_treebuilder_filter_cb)(
* @param filter Callback to filter entries
* @param payload Extra data to pass to filter callback
*/
-GIT_EXTERN(int) git_treebuilder_filter(
+GIT_EXTERN(void) git_treebuilder_filter(
git_treebuilder *bld,
git_treebuilder_filter_cb filter,
void *payload);