[libgit2-glib] repository: more fixes on the tree builder api break
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] repository: more fixes on the tree builder api break
- Date: Sun, 18 Jan 2015 15:14:43 +0000 (UTC)
commit 20e0d7b91b04c8d863e704084d38d9cbfe6d1817
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sun Jan 18 16:14:22 2015 +0100
repository: more fixes on the tree builder api break
libgit2-glib/ggit-repository.c | 25 +++++++++++++++++--------
libgit2-glib/ggit-repository.h | 7 ++++---
2 files changed, 21 insertions(+), 11 deletions(-)
---
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index 822d1fb..ec20ccd 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -2547,22 +2547,30 @@ ggit_repository_create_commit_from_ids (GgitRepository *repository,
/**
* ggit_repository_create_tree_builder:
* @repository: a #GgitRepository.
+ * @error: a #GError for error reporting, or %NULL.
*
* Create a new tree builder.
*
- * Returns: (transfer full): a #GgitTreeBuilder.
- *
+ * Returns: (transfer full): a new #GgitTreeBuilder, or %NULL if there was an error.
**/
GgitTreeBuilder *
-ggit_repository_create_tree_builder (GgitRepository *repository)
+ggit_repository_create_tree_builder (GgitRepository *repository,
+ GError **error)
{
+ gint ret;
git_treebuilder *builder;
g_return_val_if_fail (GGIT_IS_REPOSITORY (repository), NULL);
- git_treebuilder_new (&builder,
- _ggit_native_get (repository),
- NULL);
+ ret = git_treebuilder_new (&builder,
+ _ggit_native_get (repository),
+ NULL);
+
+ if (ret != GIT_OK)
+ {
+ _ggit_error_set (error, ret);
+ return NULL;
+ }
return _ggit_tree_builder_wrap (builder, repository, TRUE);
}
@@ -2576,7 +2584,6 @@ ggit_repository_create_tree_builder (GgitRepository *repository)
* tree builder, use #ggit_repository_create_tree_builder instead.
*
* Returns: (transfer full): a new #GgitTreeBuilder object, or %NULL if there was an error.
- *
**/
GgitTreeBuilder *
ggit_repository_create_tree_builder_from_tree (GgitRepository *repository,
@@ -2590,7 +2597,9 @@ ggit_repository_create_tree_builder_from_tree (GgitRepository *repository,
g_return_val_if_fail (GGIT_IS_TREE (tree), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- ret = git_treebuilder_create (&builder, _ggit_native_get (tree));
+ ret = git_treebuilder_new (&builder,
+ _ggit_native_get (repository),
+ _ggit_native_get (tree));
if (ret != GIT_OK)
{
diff --git a/libgit2-glib/ggit-repository.h b/libgit2-glib/ggit-repository.h
index e47ae60..2a99e7e 100644
--- a/libgit2-glib/ggit-repository.h
+++ b/libgit2-glib/ggit-repository.h
@@ -192,14 +192,15 @@ gboolean ggit_repository_tag_foreach (GgitRepository *re
gpointer user_data,
GError **error);
+GgitTreeBuilder *ggit_repository_create_tree_builder (
+ GgitRepository *repository,
+ GError **error);
+
GgitTreeBuilder *ggit_repository_create_tree_builder_from_tree (
GgitRepository *repository,
GgitTree *tree,
GError **error);
-GgitTreeBuilder *ggit_repository_create_tree_builder (
- GgitRepository *repository);
-
GgitIndexEntry *ggit_repository_create_index_entry_for_file (
GgitRepository *repository,
GFile *file,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]