[libgit2-glib] Fix GgitCloneOptions to compile



commit 08fc0d96fe581cc18c96668cec083c393b73dc80
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Nov 21 16:49:54 2013 +0100

    Fix GgitCloneOptions to compile
    
    This is still missing the new things

 libgit2-glib/ggit-clone-options.c |  236 -------------------------------------
 libgit2-glib/ggit-clone-options.h |   28 -----
 2 files changed, 0 insertions(+), 264 deletions(-)
---
diff --git a/libgit2-glib/ggit-clone-options.c b/libgit2-glib/ggit-clone-options.c
index 8b5c07a..6e63e78 100644
--- a/libgit2-glib/ggit-clone-options.c
+++ b/libgit2-glib/ggit-clone-options.c
@@ -27,10 +27,6 @@
 struct _GgitCloneOptions
 {
        git_clone_options clone_options;
-       GgitCredAcquireCallback cred_callback;
-       gpointer cred_user_data;
-       GgitTransferProgressCallback fetch_progress_callback;
-       gpointer fetch_progress_user_data;
 };
 
 G_DEFINE_BOXED_TYPE (GgitCloneOptions, ggit_clone_options,
@@ -50,35 +46,6 @@ _ggit_clone_options_get_clone_options (GgitCloneOptions *clone_options)
        return (const git_clone_options *)&clone_options->clone_options;
 }
 
-static gint
-wrap_cred_acquire (git_cred **cred,
-                   const char *url,
-                   const char *username_from_url,
-                   unsigned int allowed_types,
-                   void *payload)
-{
-       GgitCred *gcred;
-       GgitCloneOptions *options = GGIT_CLONE_OPTIONS (payload);
-       gint ret;
-
-       ret= options->cred_callback (url, username_from_url, allowed_types, &gcred,
-                                    options->cred_user_data);
-
-       *cred = NULL;
-
-       if (gcred != NULL)
-       {
-               *cred = _ggit_native_get (gcred);
-
-               // NOTE: this is to be able to unref the cred and do not
-               // free wrapped object
-               _ggit_native_set_destroy_func (gcred, NULL);
-               g_object_unref (gcred);
-       }
-
-       return ret;
-}
-
 /**
  * ggit_clone_options_copy:
  * @clone_options: a #GgitCloneOptions.
@@ -101,18 +68,10 @@ ggit_clone_options_copy (GgitCloneOptions *clone_options)
        new_clone_options = g_slice_new (GgitCloneOptions);
 
        gnew_clone_options.bare = gclone_options->bare;
-       gnew_clone_options.fetch_progress_cb = gclone_options->fetch_progress_cb;
-       gnew_clone_options.fetch_progress_payload = gclone_options->fetch_progress_payload;
        gnew_clone_options.remote_name = g_strdup (gclone_options->remote_name);
-       gnew_clone_options.pushurl = g_strdup (gclone_options->pushurl);
-       gnew_clone_options.fetch_spec = g_strdup (gclone_options->fetch_spec);
-       gnew_clone_options.push_spec = g_strdup (gclone_options->push_spec);
-       gnew_clone_options.remote_autotag = gclone_options->remote_autotag;
        gnew_clone_options.checkout_branch = g_strdup (gclone_options->checkout_branch);
 
        new_clone_options->clone_options = gnew_clone_options;
-       new_clone_options->cred_callback = clone_options->cred_callback;
-       new_clone_options->cred_user_data = clone_options->cred_user_data;
 
        return new_clone_options;
 }
@@ -132,9 +91,6 @@ ggit_clone_options_free (GgitCloneOptions *clone_options)
 
        gclone_options = &clone_options->clone_options;
        g_free ((gchar *)gclone_options->remote_name);
-       g_free ((gchar *)gclone_options->pushurl);
-       g_free ((gchar *)gclone_options->fetch_spec);
-       g_free ((gchar *)gclone_options->push_spec);
        g_free ((gchar *)gclone_options->checkout_branch);
 
        g_slice_free (GgitCloneOptions, clone_options);
@@ -191,45 +147,6 @@ ggit_clone_options_set_is_bare (GgitCloneOptions *options,
        options->clone_options.bare = bare;
 }
 
-static int
-wrap_fetch_progress (const git_transfer_progress *stats,
-                     gpointer                     data)
-{
-       GgitCloneOptions *options = (GgitCloneOptions *)data;
-       GgitTransferProgress *gstats;
-       gint ret;
-
-       gstats = _ggit_transfer_progress_wrap (stats);
-
-       ret = options->fetch_progress_callback (gstats, options->fetch_progress_user_data);
-       ggit_transfer_progress_free (gstats);
-
-       return ret;
-}
-
-/**
- * ggit_clone_options_set_fetch_progress_callback:
- * @options: a #GgitCloneOptions.
- * @callback: (allow-none) (scope call) (closure user_data): callback for fetch progress.
- * @user_data: callback user data.
- *
- * Sets the callback for fetch progress. Be aware that this is called inline
- * with network and indexing operations, so performance may be affected.
- */
-void
-ggit_clone_options_set_fetch_progress_callback (GgitCloneOptions             *options,
-                                                GgitTransferProgressCallback  callback,
-                                                gpointer                      user_data)
-{
-       g_return_if_fail (options != NULL);
-
-       options->fetch_progress_callback = callback;
-       options->fetch_progress_user_data = user_data;
-
-       options->clone_options.fetch_progress_cb = wrap_fetch_progress;
-       options->clone_options.fetch_progress_payload = options;
-}
-
 /**
  * ggit_clone_options_get_remote_name:
  * @options: a #GgitCloneOptions.
@@ -263,159 +180,6 @@ ggit_clone_options_set_remote_name (GgitCloneOptions *options,
 }
 
 /**
- * ggit_clone_options_get_push_url:
- * @options: a #GgitCloneOptions.
- *
- * Gets the URL to be used for pushing or %NULL.
- *
- * Returns: the URL to be used for pushing or %NULL.
- */
-const gchar *
-ggit_clone_options_get_push_url (GgitCloneOptions *options)
-{
-       g_return_val_if_fail (options != NULL, NULL);
-
-       return options->clone_options.pushurl;
-}
-
-/**
- * ggit_clone_options_set_push_url:
- * @options: a #GgitCloneOptions.
- * @push_url: (allow-none): the URL to be used for pushing. %NULL means use the fetch url.
- *
- * Sets the URL to be used for pushing. %NULL means use the fetch url.
- */
-void
-ggit_clone_options_set_push_url (GgitCloneOptions *options,
-                                 const gchar      *push_url)
-{
-       g_return_if_fail (options != NULL);
-
-       options->clone_options.pushurl = g_strdup (push_url);
-}
-
-/**
- * ggit_clone_options_get_fetch_spec:
- * @options: a #GgitCloneOptions.
- *
- * Gets the fetch specification to be used or %NULL.
- *
- * Returns: the fetch specification to be used for fetching or %NULL.
- */
-const gchar *
-ggit_clone_options_get_fetch_spec (GgitCloneOptions *options)
-{
-       g_return_val_if_fail (options != NULL, NULL);
-
-       return options->clone_options.fetch_spec;
-}
-
-/**
- * ggit_clone_options_set_fetch_spec:
- * @options: a #GgitCloneOptions.
- * @fetch_spec: (allow-none): the fetch specification to be used for fetching or %NULL.
- *
- * Sets the fetch specification to be used for fetching. %NULL
- * results in the same behavior as %GGIT_REMOTE_DEFAULT_FETCH.
- */
-void
-ggit_clone_options_set_fetch_spec (GgitCloneOptions *options,
-                                   const gchar      *fetch_spec)
-{
-       g_return_if_fail (options != NULL);
-
-       options->clone_options.fetch_spec = g_strdup (fetch_spec);
-}
-
-/**
- * ggit_clone_options_get_push_spec:
- * @options: a #GgitCloneOptions.
- *
- * Gets the fetch specification to be used for pushing or %NULL.
- *
- * Returns: the fetch specification to be used for pushing or %NULL.
- */
-const gchar *
-ggit_clone_options_get_push_spec (GgitCloneOptions *options)
-{
-       g_return_val_if_fail (options != NULL, NULL);
-
-       return options->clone_options.push_spec;
-}
-
-/**
- * ggit_clone_options_set_push_spec:
- * @options: a #GgitCloneOptions.
- * @push_spec: (allow-none): the fetch specification to be used for pushing or %NULL.
- *
- * Sets fetch specification to be used for pushing. %NULL means
- * use the same spec as for fetching.
- */
-void
-ggit_clone_options_set_push_spec (GgitCloneOptions *options,
-                                  const gchar      *push_spec)
-{
-       g_return_if_fail (options != NULL);
-
-       options->clone_options.push_spec = g_strdup (push_spec);
-}
-
-/**
- * ggit_clone_options_set_cred_acquire_callback:
- * @options: a #GgitCloneOptions.
- * @callback: (allow-none) (scope call) (closure user_data): callback if credentials are required.
- * @user_data: callback user data.
- *
- * Sets the callback to be used if credentials are required
- * during the initial fetch.
- */
-void
-ggit_clone_options_set_cred_acquire_callback (GgitCloneOptions        *options,
-                                              GgitCredAcquireCallback  callback,
-                                              gpointer                 user_data)
-{
-       g_return_if_fail (options != NULL);
-
-       options->cred_callback = callback;
-       options->cred_user_data = user_data;
-       options->clone_options.cred_acquire_cb = wrap_cred_acquire;
-       options->clone_options.cred_acquire_payload = options;
-}
-
-/**
- * ggit_clone_options_get_remote_auto_tag:
- * @options: a #GgitCloneOptions.
- *
- * Gets the auto tag setting before the initial fetch.
- * The default is @GGIT_REMOTE_DOWNLOAD_TAGS_ALL.
- *
- * Returns: a #GgitRemoteDownloadTagsType
- */
-GgitRemoteDownloadTagsType
-ggit_clone_options_get_remote_auto_tag (GgitCloneOptions *options)
-{
-       g_return_val_if_fail (options != NULL, GGIT_REMOTE_DOWNLOAD_TAGS_ALL);
-
-       return options->clone_options.remote_autotag;
-}
-
-/**
- * ggit_clone_options_set_remote_auto_tag:
- * @options: a #GgitCloneOptions.
- * @remote_auto_tag: a #GgitRemoteDownloadTagsType.
- *
- * Specifies the auto tag setting before the initial fetch.
- */
-void
-ggit_clone_options_set_remote_auto_tag (GgitCloneOptions           *options,
-                                        GgitRemoteDownloadTagsType  remote_auto_tag)
-{
-       g_return_if_fail (options != NULL);
-
-       options->clone_options.remote_autotag = remote_auto_tag;
-}
-
-/**
  * ggit_clone_options_get_checkout_branch:
  * @options: a #GgitCloneOptions.
  *
diff --git a/libgit2-glib/ggit-clone-options.h b/libgit2-glib/ggit-clone-options.h
index b54278d..d086138 100644
--- a/libgit2-glib/ggit-clone-options.h
+++ b/libgit2-glib/ggit-clone-options.h
@@ -46,39 +46,11 @@ gboolean                   ggit_clone_options_get_is_bare         (GgitCloneOpti
 void                       ggit_clone_options_set_is_bare         (GgitCloneOptions        *options,
                                                                    gboolean                 bare);
 
-void                       ggit_clone_options_set_fetch_progress_callback (GgitCloneOptions             
*options,
-                                                                           GgitTransferProgressCallback  
callback,
-                                                                           gpointer                      
user_data);
-
 const gchar               *ggit_clone_options_get_remote_name     (GgitCloneOptions        *options);
 
 void                       ggit_clone_options_set_remote_name     (GgitCloneOptions        *options,
                                                                    const gchar             *remote_name);
 
-const gchar               *ggit_clone_options_get_push_url        (GgitCloneOptions        *options);
-
-void                       ggit_clone_options_set_push_url        (GgitCloneOptions        *options,
-                                                                   const gchar             *push_url);
-
-const gchar               *ggit_clone_options_get_fetch_spec      (GgitCloneOptions        *options);
-
-void                       ggit_clone_options_set_fetch_spec      (GgitCloneOptions        *options,
-                                                                   const gchar             *fetch_spec);
-
-const gchar               *ggit_clone_options_get_push_spec       (GgitCloneOptions        *options);
-
-void                       ggit_clone_options_set_push_spec       (GgitCloneOptions        *options,
-                                                                   const gchar             *push_spec);
-
-void                       ggit_clone_options_set_cred_acquire_callback (GgitCloneOptions        *options,
-                                                                         GgitCredAcquireCallback  callback,
-                                                                         gpointer                 user_data);
-
-GgitRemoteDownloadTagsType ggit_clone_options_get_remote_auto_tag (GgitCloneOptions        *options);
-
-void                       ggit_clone_options_set_remote_auto_tag (GgitCloneOptions           *options,
-                                                                   GgitRemoteDownloadTagsType  
remote_auto_tag);
-
 const gchar               *ggit_clone_options_get_checkout_branch (GgitCloneOptions        *options);
 
 void                       ggit_clone_options_set_checkout_branch (GgitCloneOptions        *options,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]