summaryrefslogtreecommitdiff
path: root/src/tree.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-01-18 17:38:36 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2020-01-24 15:12:56 -0600
commit3351506aa8ef2b14d28fca5fb4edd55b2f15ad1b (patch)
treea980abc8785b286b4049335c60bcc567c73d2274 /src/tree.c
parent2e8c3b0b18896ac8aeaed758da51f3ea9c133fe8 (diff)
downloadlibgit2-3351506aa8ef2b14d28fca5fb4edd55b2f15ad1b.tar.gz
tree functions: return an int
Stop returning a void for functions, future-proofing them to allow them to fail.
Diffstat (limited to 'src/tree.c')
-rw-r--r--src/tree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tree.c b/src/tree.c
index cd6ab9b2f..48468dff6 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -834,7 +834,7 @@ out:
return error;
}
-void git_treebuilder_filter(
+int git_treebuilder_filter(
git_treebuilder *bld,
git_treebuilder_filter_cb filter,
void *payload)
@@ -850,9 +850,11 @@ void git_treebuilder_filter(
git_tree_entry_free(entry);
}
});
+
+ return 0;
}
-void git_treebuilder_clear(git_treebuilder *bld)
+int git_treebuilder_clear(git_treebuilder *bld)
{
git_tree_entry *e;
@@ -860,6 +862,8 @@ void git_treebuilder_clear(git_treebuilder *bld)
git_strmap_foreach_value(bld->map, e, git_tree_entry_free(e));
git_strmap_clear(bld->map);
+
+ return 0;
}
void git_treebuilder_free(git_treebuilder *bld)