[libgit2-glib/wip/development: 12/12] Update bindings to the latest libgit2 API changes 0.19.0
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib/wip/development: 12/12] Update bindings to the latest libgit2 API changes 0.19.0
- Date: Tue, 25 Jun 2013 06:22:16 +0000 (UTC)
commit eb4bd04929c391f67f3cb96c9058d9a1f577add0
Author: Sindhu S <sindhus live in>
Date: Wed Jun 5 01:39:31 2013 +0530
Update bindings to the latest libgit2 API changes 0.19.0
docs/reference/libgit2-glib-1.0-sections.txt | 6 +--
libgit2-glib/ggit-index-entry-resolve-undo.c | 1 +
libgit2-glib/ggit-remote.c | 62 +++-----------------------
libgit2-glib/ggit-remote.h | 6 +--
libgit2-glib/ggit-repository.c | 24 ++++------
libgit2-glib/ggit-repository.h | 9 ++--
libgit2-glib/ggit-types.c | 20 ++++----
libgit2-glib/ggit-types.h | 36 +++++++-------
8 files changed, 53 insertions(+), 111 deletions(-)
---
diff --git a/docs/reference/libgit2-glib-1.0-sections.txt b/docs/reference/libgit2-glib-1.0-sections.txt
index ac8a16f..f2e433c 100644
--- a/docs/reference/libgit2-glib-1.0-sections.txt
+++ b/docs/reference/libgit2-glib-1.0-sections.txt
@@ -588,10 +588,8 @@ ggit_remote_get_url
ggit_remote_connect
ggit_remote_get_connected
ggit_remote_disconnect
-ggit_remote_set_fetch_spec
-ggit_remote_get_fetch_spec
-ggit_remote_set_push_spec
-ggit_remote_get_push_spec
+ggit_remote_add_fetch_spec
+ggit_remote_add_push_spec
ggit_remote_list
ggit_remote_is_valid_url
ggit_remote_is_supported_url
diff --git a/libgit2-glib/ggit-index-entry-resolve-undo.c b/libgit2-glib/ggit-index-entry-resolve-undo.c
index 70a383d..0d344b8 100644
--- a/libgit2-glib/ggit-index-entry-resolve-undo.c
+++ b/libgit2-glib/ggit-index-entry-resolve-undo.c
@@ -20,6 +20,7 @@
#include "ggit-index-entry-resolve-undo.h"
#include "ggit-index.h"
+#include <git2/sys/index.h>
struct _GgitIndexEntriesResolveUndo
{
diff --git a/libgit2-glib/ggit-remote.c b/libgit2-glib/ggit-remote.c
index de5c4ff..f554d2c 100644
--- a/libgit2-glib/ggit-remote.c
+++ b/libgit2-glib/ggit-remote.c
@@ -239,7 +239,7 @@ ggit_remote_disconnect (GgitRemote *remote)
}
/**
- * ggit_remote_set_fetch_spec:
+ * ggit_remote_add_fetch_spec:
* @remote: a #GgitRemote.
* @fetch_spec: the fetch refspec.
* @error: a #GError for error reporting, or %NULL.
@@ -247,7 +247,7 @@ ggit_remote_disconnect (GgitRemote *remote)
* Sets @remote's fetch spec to @fetch_spec.
*/
void
-ggit_remote_set_fetch_spec (GgitRemote *remote,
+ggit_remote_add_fetch_spec (GgitRemote *remote,
const gchar *fetch_spec,
GError **error)
{
@@ -257,7 +257,7 @@ ggit_remote_set_fetch_spec (GgitRemote *remote,
g_return_if_fail (fetch_spec != NULL && fetch_spec[0] != '\0');
g_return_if_fail (error == NULL || *error == NULL);
- ret = git_remote_set_fetchspec (remote->remote, fetch_spec);
+ ret = git_remote_add_fetch (remote->remote, fetch_spec);
if (ret != GIT_OK)
{
@@ -266,32 +266,7 @@ ggit_remote_set_fetch_spec (GgitRemote *remote,
}
/**
- * ggit_remote_get_fetch_spec:
- * @remote: a #GgitRemote.
- *
- * Gets @remote's fetch spec.
- *
- * Returns: the fetch spec of the remote, or %NULL.
- */
-GgitRefSpec *
-ggit_remote_get_fetch_spec (GgitRemote *remote)
-{
- const git_refspec *refspec;
-
- g_return_val_if_fail (remote != NULL, NULL);
-
- refspec = git_remote_fetchspec (remote->remote);
-
- if (refspec == NULL)
- {
- return NULL;
- }
-
- return _ggit_ref_spec_wrap (refspec);
-}
-
-/**
- * ggit_remote_set_push_spec:
+ * ggit_remote_add_push_spec:
* @remote: a #GgitRemote.
* @push_spec: the push refspec.
* @error: a #GError for error reporting, or %NULL.
@@ -299,7 +274,7 @@ ggit_remote_get_fetch_spec (GgitRemote *remote)
* Sets @remote's push spec to @fetch_spec.
*/
void
-ggit_remote_set_push_spec (GgitRemote *remote,
+ggit_remote_add_push_spec (GgitRemote *remote,
const gchar *push_spec,
GError **error)
{
@@ -309,7 +284,7 @@ ggit_remote_set_push_spec (GgitRemote *remote,
g_return_if_fail (push_spec != NULL && push_spec[0] != '\0');
g_return_if_fail (error == NULL || *error == NULL);
- ret = git_remote_set_pushspec (remote->remote, push_spec);
+ ret = git_remote_add_push (remote->remote, push_spec);
if (ret != GIT_OK)
{
@@ -317,31 +292,6 @@ ggit_remote_set_push_spec (GgitRemote *remote,
}
}
-/**
- * ggit_remote_get_push_spec:
- * @remote: a #GgitRemote.
- *
- * Gets @remote's push spec.
- *
- * Returns: the push spec of the remote, or %NULL.
- */
-GgitRefSpec *
-ggit_remote_get_push_spec (GgitRemote *remote)
-{
- const git_refspec *refspec;
-
- g_return_val_if_fail (remote != NULL, NULL);
-
- refspec = git_remote_pushspec (remote->remote);
-
- if (refspec == NULL)
- {
- return NULL;
- }
-
- return _ggit_ref_spec_wrap (refspec);
-}
-
typedef struct {
GgitRemoteListCallback callback;
gpointer user_data;
diff --git a/libgit2-glib/ggit-remote.h b/libgit2-glib/ggit-remote.h
index 3539dd7..61e3e19 100644
--- a/libgit2-glib/ggit-remote.h
+++ b/libgit2-glib/ggit-remote.h
@@ -58,15 +58,13 @@ gboolean ggit_remote_get_connected (GgitRemote *remot
void ggit_remote_disconnect (GgitRemote *remote);
-void ggit_remote_set_fetch_spec (GgitRemote *remote,
+void ggit_remote_add_fetch_spec (GgitRemote *remote,
const gchar *fetch_spec,
GError **error);
-GgitRefSpec *ggit_remote_get_fetch_spec (GgitRemote *remote);
-void ggit_remote_set_push_spec (GgitRemote *remote,
+void ggit_remote_add_push_spec (GgitRemote *remote,
const gchar *push_spec,
GError **error);
-GgitRefSpec *ggit_remote_get_push_spec (GgitRemote *remote);
void ggit_remote_list (GgitRemote *remote,
GgitRemoteListCallback callback,
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index 14395df..7a3c574 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -1062,10 +1062,9 @@ ggit_repository_file_status_foreach (GgitRepository *repository,
}
/**
- * ggit_repository_references_foreach:
+ * ggit_repository_references_foreach_name:
* @repository: a #GgitRepository.
- * @reftype: a #GgitRefType
- * @callback: (scope call): a #GgitReferencesCallback.
+ * @callback: (scope call): a #GgitReferencesNameCallback.
* @user_data: callback user data.
* @error: a #GError for error reporting, or %NULL.
*
@@ -1073,18 +1072,16 @@ ggit_repository_file_status_foreach (GgitRepository *repository,
*
* To the callback is passed the name of the reference and the data pointer
* passed to this function. If the callback returns something other than
- * 0, the iteration will stop and @error will be set. The references are
- * filtered by @reftype.
+ * 0, the iteration will stop and @error will be set.
*
* Returns: %TRUE if there was no error, %FALSE otherwise
*
*/
gboolean
-ggit_repository_references_foreach (GgitRepository *repository,
- GgitRefType reftype,
- GgitReferencesCallback callback,
- gpointer user_data,
- GError **error)
+ggit_repository_references_foreach_name (GgitRepository *repository,
+ GgitReferencesNameCallback callback,
+ gpointer user_data,
+ GError **error)
{
gint ret;
@@ -1092,10 +1089,9 @@ ggit_repository_references_foreach (GgitRepository *repository,
g_return_val_if_fail (callback != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- ret = git_reference_foreach (_ggit_native_get (repository),
- reftype,
- callback,
- user_data);
+ ret = git_reference_foreach_name (_ggit_native_get (repository),
+ callback,
+ user_data);
if (ret != GIT_OK)
{
diff --git a/libgit2-glib/ggit-repository.h b/libgit2-glib/ggit-repository.h
index 8c5309d..b2df7b3 100644
--- a/libgit2-glib/ggit-repository.h
+++ b/libgit2-glib/ggit-repository.h
@@ -208,11 +208,10 @@ gboolean ggit_repository_file_status_foreach
gpointer user_data,
GError **error);
-gboolean ggit_repository_references_foreach (GgitRepository *repository,
- GgitRefType reftype,
- GgitReferencesCallback callback,
- gpointer user_data,
- GError **error);
+gboolean ggit_repository_references_foreach_name (GgitRepository *repository,
+ GgitReferencesNameCallback callback,
+ gpointer user_data,
+ GError **error);
GgitConfig *ggit_repository_get_config (GgitRepository *repository,
GError **error);
diff --git a/libgit2-glib/ggit-types.c b/libgit2-glib/ggit-types.c
index 4c7b8b0..349c5d1 100644
--- a/libgit2-glib/ggit-types.c
+++ b/libgit2-glib/ggit-types.c
@@ -77,14 +77,15 @@ ASSERT_ENUM (GGIT_DIFF_FLAG_BINARY, GIT_DIFF_FLAG_BINARY);
ASSERT_ENUM (GGIT_DIFF_FLAG_NOT_BINARY, GIT_DIFF_FLAG_NOT_BINARY);
-ASSERT_ENUM (GGIT_DIFF_LINE_CONTEXT, GIT_DIFF_LINE_CONTEXT);
-ASSERT_ENUM (GGIT_DIFF_LINE_ADDITION, GIT_DIFF_LINE_ADDITION);
-ASSERT_ENUM (GGIT_DIFF_LINE_DELETION, GIT_DIFF_LINE_DELETION);
-ASSERT_ENUM (GGIT_DIFF_LINE_ADD_EOFNL, GIT_DIFF_LINE_ADD_EOFNL);
-ASSERT_ENUM (GGIT_DIFF_LINE_DEL_EOFNL, GIT_DIFF_LINE_DEL_EOFNL);
-ASSERT_ENUM (GGIT_DIFF_LINE_FILE_HDR, GIT_DIFF_LINE_FILE_HDR);
-ASSERT_ENUM (GGIT_DIFF_LINE_HUNK_HDR, GIT_DIFF_LINE_HUNK_HDR);
-ASSERT_ENUM (GGIT_DIFF_LINE_BINARY, GIT_DIFF_LINE_BINARY);
+ASSERT_ENUM (GGIT_DIFF_LINE_CONTEXT, GIT_DIFF_LINE_CONTEXT);
+ASSERT_ENUM (GGIT_DIFF_LINE_ADDITION, GIT_DIFF_LINE_ADDITION);
+ASSERT_ENUM (GGIT_DIFF_LINE_DELETION, GIT_DIFF_LINE_DELETION);
+ASSERT_ENUM (GGIT_DIFF_LINE_CONTEXT_EOFNL, GIT_DIFF_LINE_CONTEXT_EOFNL);
+ASSERT_ENUM (GGIT_DIFF_LINE_ADD_EOFNL, GIT_DIFF_LINE_ADD_EOFNL);
+ASSERT_ENUM (GGIT_DIFF_LINE_DEL_EOFNL, GIT_DIFF_LINE_DEL_EOFNL);
+ASSERT_ENUM (GGIT_DIFF_LINE_FILE_HDR, GIT_DIFF_LINE_FILE_HDR);
+ASSERT_ENUM (GGIT_DIFF_LINE_HUNK_HDR, GIT_DIFF_LINE_HUNK_HDR);
+ASSERT_ENUM (GGIT_DIFF_LINE_BINARY, GIT_DIFF_LINE_BINARY);
ASSERT_ENUM (GGIT_ERROR_GIT_ERROR, GIT_ERROR);
@@ -102,9 +103,8 @@ ASSERT_ENUM (GGIT_FILEMODE_BLOB_EXECUTABLE, GIT_FILEMODE_BLOB_EXECUTABLE);
ASSERT_ENUM (GGIT_FILEMODE_LINK, GIT_FILEMODE_LINK);
ASSERT_ENUM (GGIT_FILEMODE_COMMIT, GIT_FILEMODE_COMMIT);
-ASSERT_ENUM (GGIT_REMOTE_DOWNLOAD_TAGS_UNSET, GIT_REMOTE_DOWNLOAD_TAGS_UNSET);
-ASSERT_ENUM (GGIT_REMOTE_DOWNLOAD_TAGS_NONE, GIT_REMOTE_DOWNLOAD_TAGS_NONE);
ASSERT_ENUM (GGIT_REMOTE_DOWNLOAD_TAGS_AUTO, GIT_REMOTE_DOWNLOAD_TAGS_AUTO);
+ASSERT_ENUM (GGIT_REMOTE_DOWNLOAD_TAGS_NONE, GIT_REMOTE_DOWNLOAD_TAGS_NONE);
ASSERT_ENUM (GGIT_REMOTE_DOWNLOAD_TAGS_ALL, GIT_REMOTE_DOWNLOAD_TAGS_ALL);
ASSERT_ENUM (GGIT_REF_INVALID, GIT_REF_INVALID);
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index 98ed8c2..ca8fec9 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -434,6 +434,7 @@ typedef enum {
* @GGIT_DIFF_LINE_CONTEXT: line is part of the context.
* @GGIT_DIFF_LINE_ADDITION: line that was added.
* @GGIT_DIFF_LINE_DELETION: line that was removed.
+ * @GGIT_DIFF_LINE_CONTEXT_EOFNL: Both files have no LF at end.
* @GGIT_DIFF_LINE_ADD_EOFNL: LF was added at end of file.
* @GGIT_DIFF_LINE_DEL_EOFNL: LF was removed at end of file.
* @GGIT_DIFF_LINE_FILE_HDR: the file header.
@@ -447,14 +448,15 @@ typedef enum {
* #GGIT_DIFF_LINE_BINARY values are only sent when the diff is being printed.
*/
typedef enum {
- GGIT_DIFF_LINE_CONTEXT = ' ',
- GGIT_DIFF_LINE_ADDITION = '+',
- GGIT_DIFF_LINE_DELETION = '-',
- GGIT_DIFF_LINE_ADD_EOFNL = '\n',
- GGIT_DIFF_LINE_DEL_EOFNL = '\0',
- GGIT_DIFF_LINE_FILE_HDR = 'F',
- GGIT_DIFF_LINE_HUNK_HDR = 'H',
- GGIT_DIFF_LINE_BINARY = 'B'
+ GGIT_DIFF_LINE_CONTEXT = ' ',
+ GGIT_DIFF_LINE_ADDITION = '+',
+ GGIT_DIFF_LINE_DELETION = '-',
+ GGIT_DIFF_LINE_CONTEXT_EOFNL = '=',
+ GGIT_DIFF_LINE_ADD_EOFNL = '>',
+ GGIT_DIFF_LINE_DEL_EOFNL = '<',
+ GGIT_DIFF_LINE_FILE_HDR = 'F',
+ GGIT_DIFF_LINE_HUNK_HDR = 'H',
+ GGIT_DIFF_LINE_BINARY = 'B'
} GgitDiffLineType;
/* NOTE: keep in sync with git2/errors.h */
@@ -493,16 +495,14 @@ typedef enum {
/* NOTE: keep in sync with git2/refs.h */
/**
* GgitRemoteDownloadTagsType:
- * @GGIT_REMOTE_DOWNLOAD_TAGS_UNSET:
- * @GGIT_REMOTE_DOWNLOAD_TAGS_NONE:
* @GGIT_REMOTE_DOWNLOAD_TAGS_AUTO:
+ * @GGIT_REMOTE_DOWNLOAD_TAGS_NONE:
* @GGIT_REMOTE_DOWNLOAD_TAGS_ALL:
*/
typedef enum {
- GGIT_REMOTE_DOWNLOAD_TAGS_UNSET,
- GGIT_REMOTE_DOWNLOAD_TAGS_NONE,
- GGIT_REMOTE_DOWNLOAD_TAGS_AUTO,
- GGIT_REMOTE_DOWNLOAD_TAGS_ALL
+ GGIT_REMOTE_DOWNLOAD_TAGS_AUTO = 0,
+ GGIT_REMOTE_DOWNLOAD_TAGS_NONE = 1,
+ GGIT_REMOTE_DOWNLOAD_TAGS_ALL = 2
} GgitRemoteDownloadTagsType;
/* NOTE: keep in sync with git2/refs.h */
@@ -843,17 +843,17 @@ typedef gint (* GgitDiffLineCallback) (GgitDiffDelta *delta,
gpointer user_data);
/**
- * GgitReferencesCallback:
+ * GgitReferencesNameCallback:
* @name: the name of the reference
* @user_data: (closure): user-supplied data.
*
* The type of the callback functions for retrieving the references
- * in a #GgitRepository. See ggit_repository_references_foreach().
+ * in a #GgitRepository. See ggit_repository_references_foreach_name().
*
* Returns: 0 to go for the next references or a #GgitError in case there was an error.
*/
-typedef gint (* GgitReferencesCallback) (const gchar *name,
- gpointer user_data);
+typedef gint (* GgitReferencesNameCallback) (const gchar *name,
+ gpointer user_data);
/**
* GgitRemoteListCallback:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]