[libgit2-glib] Add create_repository and create_remote virtual methods to GgitCloneOptions



commit 950fc474bd184700a4aff0b4267163f74b9b15fa
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Tue Aug 4 17:27:27 2015 +0200

    Add create_repository and create_remote virtual methods to GgitCloneOptions
    
    This makes GgitCloneOptions an object instead of a boxed type.

 examples/clone.c                  |   10 +-
 libgit2-glib/ggit-clone-options.c |  313 +++++++++++++++++++++++++++++--------
 libgit2-glib/ggit-clone-options.h |   35 +++--
 libgit2-glib/ggit-remote.c        |    6 -
 libgit2-glib/ggit-repository.c    |   24 ++--
 libgit2-glib/ggit-types.c         |    5 +
 libgit2-glib/ggit-types.h         |   15 ++
 7 files changed, 310 insertions(+), 98 deletions(-)
---
diff --git a/examples/clone.c b/examples/clone.c
index 3598172..3171b36 100644
--- a/examples/clone.c
+++ b/examples/clone.c
@@ -66,6 +66,8 @@ chomp (gchar *s)
        }
 }
 
+static gboolean tried_ssh_key = FALSE;
+
 static GgitCred *
 cloner_credentials (GgitRemoteCallbacks  *callbacks,
                     const gchar          *url,
@@ -80,6 +82,12 @@ cloner_credentials (GgitRemoteCallbacks  *callbacks,
 
        g_return_val_if_fail (error != NULL && *error == NULL, NULL);
 
+       if ((allowed_types & GGIT_CREDTYPE_SSH_KEY) != 0 && !tried_ssh_key)
+       {
+               tried_ssh_key = TRUE;
+               return GGIT_CRED (ggit_cred_ssh_key_from_agent_new (username_from_url, error));
+       }
+
        g_printf ("Username: ");
 
        if (fgets (username, sizeof (username) - 1, stdin) == NULL)
@@ -186,6 +194,6 @@ int main(int argc, char **argv)
                g_object_unref (cloned_repo);
        }
 
-       ggit_clone_options_free (options);
+       g_object_unref (options);
        return 0;
 }
diff --git a/libgit2-glib/ggit-clone-options.c b/libgit2-glib/ggit-clone-options.c
index 729b97a..1288a82 100644
--- a/libgit2-glib/ggit-clone-options.c
+++ b/libgit2-glib/ggit-clone-options.c
@@ -19,88 +19,208 @@
  */
 
 #include <git2.h>
+#include <gio/gio.h>
 
 #include "ggit-clone-options.h"
 #include "ggit-transfer-progress.h"
 #include "ggit-native.h"
+#include "ggit-remote.h"
+#include "ggit-repository.h"
 
-struct _GgitCloneOptions
+typedef struct _GgitCloneOptionsPrivate
 {
-       git_clone_options clone_options;
+       git_clone_options native;
        GgitFetchOptions *fetch_options;
-};
+} GgitCloneOptionsPrivate;
 
-G_DEFINE_BOXED_TYPE (GgitCloneOptions, ggit_clone_options,
-                     ggit_clone_options_copy, ggit_clone_options_free)
+/**
+ * GgitCloneOptionsClass::create_repository:
+ * @options: a #GgitCloneOptions.
+ * @path: the repository path.
+ * @is_bare: whether a bare repository should be created.
+ * @error: a #GError for error reporting.
+ *
+ * Returns: (transfer full) (nullable): a #GgitRepository or %NULL in case of an error.
+ */
+
+/**
+ * GgitCloneOptionsClass::create_remote:
+ * @options: a #GgitCloneOptions.
+ * @repository: the repository.
+ * @name: the remote name.
+ * @url: the remote url.
+ * @error: a #GError for error reporting.
+ *
+ * Returns: (transfer full) (nullable): a #GgitRemote or %NULL in case of an error.
+ */
+
+G_DEFINE_TYPE_WITH_PRIVATE (GgitCloneOptions, ggit_clone_options, G_TYPE_OBJECT)
 
 const git_clone_options *
-_ggit_clone_options_get_clone_options (GgitCloneOptions *clone_options)
+_ggit_clone_options_get_native (GgitCloneOptions *options)
 {
+       GgitCloneOptionsPrivate *priv;
+
        /* NULL is common for clone_options as it specifies to use the default
         * so handle a NULL clone_options here instead of in every caller.
         */
-       if (clone_options == NULL)
+       if (options == NULL)
        {
                return NULL;
        }
 
-       return (const git_clone_options *)&clone_options->clone_options;
+       g_return_val_if_fail (GGIT_IS_CLONE_OPTIONS (options), NULL);
+
+       priv = ggit_clone_options_get_instance_private (options);
+
+       return (const git_clone_options *)&priv->native;
 }
 
-/**
- * ggit_clone_options_copy:
- * @clone_options: a #GgitCloneOptions.
- *
- * Copies @clone_options into a newly allocated #GgitCloneOptions.
- *
- * Returns: (transfer full): a newly allocated #GgitCloneOptions.
- */
-GgitCloneOptions *
-ggit_clone_options_copy (GgitCloneOptions *clone_options)
+static void
+ggit_clone_options_finalize (GObject *object)
+{
+       GgitCloneOptions *options = GGIT_CLONE_OPTIONS (object);
+       GgitCloneOptionsPrivate *priv;
+
+       priv = ggit_clone_options_get_instance_private (options);
+
+       g_free ((gchar *)priv->native.checkout_branch);
+
+       ggit_fetch_options_free (priv->fetch_options);
+
+       priv->native.repository_cb = NULL;
+       priv->native.repository_cb_payload = NULL;
+
+       priv->native.remote_cb = NULL;
+       priv->native.remote_cb_payload = NULL;
+
+       G_OBJECT_CLASS (ggit_clone_options_parent_class)->finalize (object);
+}
+
+static GgitRepository *
+create_repository_default (GgitCloneOptions  *options,
+                           const gchar       *path,
+                           gboolean           is_bare,
+                           GError           **error)
+{
+       GFile *location;
+       GgitRepository *ret;
+
+       location = g_file_new_for_path (path);
+       ret = ggit_repository_init_repository (location, is_bare, error);
+       g_object_unref (location);
+
+       return ret;
+}
+
+static GgitRemote *
+create_remote_default (GgitCloneOptions  *options,
+                       GgitRepository    *repository,
+                       const gchar       *name,
+                       const gchar       *url,
+                       GError           **error)
+{
+       return ggit_remote_new (repository, name, url, error);
+}
+
+static void
+ggit_clone_options_class_init (GgitCloneOptionsClass *klass)
 {
-       GgitCloneOptions *new_clone_options;
-       git_clone_options *gclone_options;
-       git_clone_options gnew_clone_options = GIT_CLONE_OPTIONS_INIT;
+       GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-       g_return_val_if_fail (clone_options != NULL, NULL);
+       object_class->finalize = ggit_clone_options_finalize;
 
-       gclone_options = &clone_options->clone_options;
+       klass->create_repository = create_repository_default;
+       klass->create_remote = create_remote_default;
+}
 
-       new_clone_options = g_slice_new0 (GgitCloneOptions);
+static gint
+create_repository_wrapper (git_repository **out,
+                           const char      *path,
+                           gint             is_bare,
+                           void            *payload)
+{
+       GgitCloneOptions *options = GGIT_CLONE_OPTIONS (payload);
+       GgitCloneOptionsClass *cls = GGIT_CLONE_OPTIONS_GET_CLASS (options);
+       GError *error = NULL;
+       GgitRepository *repository;
 
-       gnew_clone_options.bare = gclone_options->bare;
-       gnew_clone_options.checkout_branch = g_strdup (gclone_options->checkout_branch);
+       repository = cls->create_repository(options, path, is_bare ? TRUE : FALSE, &error);
 
-       if (clone_options->fetch_options)
+       if (error != NULL)
        {
-               new_clone_options->fetch_options = ggit_fetch_options_copy (clone_options->fetch_options);
-               gnew_clone_options.fetch_opts = *_ggit_fetch_options_get_fetch_options 
(new_clone_options->fetch_options);
+               giterr_set_str (GIT_ERROR, error->message);
+               g_error_free (error);
+
+               if (repository != NULL)
+               {
+                       g_object_unref (repository);
+               }
+
+               return GIT_ERROR;
        }
 
-       new_clone_options->clone_options = gnew_clone_options;
+       if (repository != NULL)
+       {
+               *out = _ggit_native_release (repository);
+               g_object_unref (repository);
+       }
 
-       return new_clone_options;
+       return GIT_OK;
 }
 
-/**
- * ggit_clone_options_free:
- * @clone_options: a #GgitCloneOptions.
- *
- * Frees @clone_options.
- */
-void
-ggit_clone_options_free (GgitCloneOptions *clone_options)
+static gint
+create_remote_wrapper (git_remote     **out,
+                       git_repository  *repo,
+                       const char      *name,
+                       const char      *url,
+                       void            *payload)
 {
-       git_clone_options *gclone_options;
+       GgitCloneOptions *options = GGIT_CLONE_OPTIONS (payload);
+       GgitCloneOptionsClass *cls = GGIT_CLONE_OPTIONS_GET_CLASS (options);
+       GgitRepository *repository = _ggit_repository_wrap (repo, FALSE);
+       GError *error = NULL;
+       GgitRemote *remote;
+
+       remote = cls->create_remote(options, repository, name, url, &error);
+       g_object_unref (repository);
+
+       if (error)
+       {
+               giterr_set_str (GIT_ERROR, error->message);
+               g_error_free (error);
+
+               if (remote != NULL)
+               {
+                       g_object_unref (remote);
+               }
+
+               return GIT_ERROR;
+       }
+
+       if (remote != NULL)
+       {
+               *out = _ggit_native_release (GGIT_NATIVE (remote));
+               g_object_unref (remote);
+       }
+
+       return GIT_OK;
+}
 
-       g_return_if_fail (clone_options != NULL);
+static void
+ggit_clone_options_init (GgitCloneOptions *options)
+{
+       git_clone_options native = GIT_CLONE_OPTIONS_INIT;
+       GgitCloneOptionsPrivate *priv;
 
-       gclone_options = &clone_options->clone_options;
-       g_free ((gchar *)gclone_options->checkout_branch);
+       native.repository_cb = create_repository_wrapper;
+       native.repository_cb_payload = options;
 
-       ggit_fetch_options_free (clone_options->fetch_options);
+       native.remote_cb = create_remote_wrapper;
+       native.remote_cb_payload = options;
 
-       g_slice_free (GgitCloneOptions, clone_options);
+       priv = ggit_clone_options_get_instance_private (options);
+       priv->native = native;
 }
 
 /**
@@ -113,13 +233,7 @@ ggit_clone_options_free (GgitCloneOptions *clone_options)
 GgitCloneOptions *
 ggit_clone_options_new (void)
 {
-       GgitCloneOptions *clone_options;
-       git_clone_options gclone_options = GIT_CLONE_OPTIONS_INIT;
-
-       clone_options = g_slice_new0 (GgitCloneOptions);
-       clone_options->clone_options = gclone_options;
-
-       return clone_options;
+       return GGIT_CLONE_OPTIONS (g_object_new (GGIT_TYPE_CLONE_OPTIONS, NULL));
 }
 
 /**
@@ -133,9 +247,12 @@ ggit_clone_options_new (void)
 gboolean
 ggit_clone_options_get_is_bare (GgitCloneOptions *options)
 {
-       g_return_val_if_fail (options != NULL, FALSE);
+       GgitCloneOptionsPrivate *priv;
+
+       g_return_val_if_fail (GGIT_IS_CLONE_OPTIONS (options), FALSE);
 
-       return options->clone_options.bare;
+       priv = ggit_clone_options_get_instance_private (options);
+       return priv->native.bare ? TRUE : FALSE;
 }
 
 /**
@@ -149,9 +266,12 @@ void
 ggit_clone_options_set_is_bare (GgitCloneOptions *options,
                                 gboolean          bare)
 {
-       g_return_if_fail (options != NULL);
+       GgitCloneOptionsPrivate *priv;
+
+       g_return_if_fail (GGIT_IS_CLONE_OPTIONS (options));
 
-       options->clone_options.bare = bare;
+       priv = ggit_clone_options_get_instance_private (options);
+       priv->native.bare = (gint)bare;
 }
 
 /**
@@ -165,9 +285,12 @@ ggit_clone_options_set_is_bare (GgitCloneOptions *options,
 const gchar *
 ggit_clone_options_get_checkout_branch (GgitCloneOptions *options)
 {
-       g_return_val_if_fail (options != NULL, NULL);
+       GgitCloneOptionsPrivate *priv;
 
-       return options->clone_options.checkout_branch;
+       g_return_val_if_fail (GGIT_IS_CLONE_OPTIONS (options), NULL);
+
+       priv = ggit_clone_options_get_instance_private (options);
+       return priv->native.checkout_branch;
 }
 
 /**
@@ -182,9 +305,12 @@ void
 ggit_clone_options_set_checkout_branch (GgitCloneOptions *options,
                                         const gchar      *checkout_branch)
 {
-       g_return_if_fail (options != NULL);
+       GgitCloneOptionsPrivate *priv;
+
+       g_return_if_fail (GGIT_IS_CLONE_OPTIONS (options));
 
-       options->clone_options.checkout_branch = g_strdup (checkout_branch);
+       priv = ggit_clone_options_get_instance_private (options);
+       priv->native.checkout_branch = g_strdup (checkout_branch);
 }
 
 /**
@@ -198,8 +324,12 @@ ggit_clone_options_set_checkout_branch (GgitCloneOptions *options,
 GgitFetchOptions *
 ggit_clone_options_get_fetch_options (GgitCloneOptions *options)
 {
-       g_return_val_if_fail (options != NULL, NULL);
-       return options->fetch_options;
+       GgitCloneOptionsPrivate *priv;
+
+       g_return_val_if_fail (GGIT_IS_CLONE_OPTIONS (options), NULL);
+
+       priv = ggit_clone_options_get_instance_private (options);
+       return priv->fetch_options;
 }
 
 /**
@@ -213,20 +343,69 @@ void
 ggit_clone_options_set_fetch_options (GgitCloneOptions *options,
                                       GgitFetchOptions *fetch_options)
 {
-       g_return_if_fail (options != NULL);
+       GgitCloneOptionsPrivate *priv;
+
+       g_return_if_fail (GGIT_IS_CLONE_OPTIONS (options));
 
-       g_clear_object (&options->fetch_options);
+       priv = ggit_clone_options_get_instance_private (options);
+
+       g_clear_object (&priv->fetch_options);
 
        if (fetch_options != NULL)
        {
-               options->fetch_options = ggit_fetch_options_copy (fetch_options);
-               options->clone_options.fetch_opts = *_ggit_fetch_options_get_fetch_options (fetch_options);
+               priv->fetch_options = ggit_fetch_options_copy (fetch_options);
+               priv->native.fetch_opts = *_ggit_fetch_options_get_fetch_options (fetch_options);
        }
        else
        {
                git_fetch_options i = GIT_FETCH_OPTIONS_INIT;
-               options->clone_options.fetch_opts = i;
+               priv->native.fetch_opts = i;
        }
 }
 
+/**
+ * ggit_clone_options_get_local:
+ * @options: a #GgitCloneOptions.
+ *
+ * Get setting for bypassing the git-aware transport when cloning. The
+ * default auto setting bypasses the git-aware transport for local paths,
+ * but use a normal fetch for file:// URIs.
+ *
+ * Returns: the local clone setting.
+ *
+ **/
+GgitCloneLocal
+ggit_clone_options_get_local (GgitCloneOptions *options)
+{
+       GgitCloneOptionsPrivate *priv;
+
+       g_return_val_if_fail (GGIT_IS_CLONE_OPTIONS (options), 0);
+
+       priv = ggit_clone_options_get_instance_private (options);
+       return (GgitCloneLocal)priv->native.local;
+}
+
+/**
+ * ggit_clone_options_set_local:
+ * @options: a #GgitCloneOptions.
+ * @local: the local clone setting.
+ *
+ * Set setting for bypassing the git-aware transport when cloning. The
+ * default auto setting bypasses the git-aware transport for local paths,
+ * but use a normal fetch for file:// URIs.
+ *
+ **/
+void
+ggit_clone_options_set_local (GgitCloneOptions *options,
+                              GgitCloneLocal    local)
+{
+       GgitCloneOptionsPrivate *priv;
+
+       g_return_if_fail (GGIT_IS_CLONE_OPTIONS (options));
+
+       priv = ggit_clone_options_get_instance_private (options);
+       priv->native.local = (git_clone_local_t)local;
+}
+
+
 /* ex:set ts=8 noet: */
diff --git a/libgit2-glib/ggit-clone-options.h b/libgit2-glib/ggit-clone-options.h
index fe93e09..b033f07 100644
--- a/libgit2-glib/ggit-clone-options.h
+++ b/libgit2-glib/ggit-clone-options.h
@@ -30,15 +30,28 @@
 
 G_BEGIN_DECLS
 
-#define GGIT_TYPE_CLONE_OPTIONS       (ggit_clone_options_get_type ())
-#define GGIT_CLONE_OPTIONS(obj)       ((GgitCloneOptions *)obj)
+#define GGIT_TYPE_CLONE_OPTIONS (ggit_clone_options_get_type ())
+G_DECLARE_DERIVABLE_TYPE (GgitCloneOptions, ggit_clone_options, GGIT, CLONE_OPTIONS, GObject)
 
-GType                      ggit_clone_options_get_type            (void) G_GNUC_CONST;
+struct _GgitCloneOptionsClass
+{
+       GObjectClass parent_class;
 
-const git_clone_options  *_ggit_clone_options_get_clone_options   (GgitCloneOptions        *clone_options);
+       /* virtual methods */
+       GgitRepository *(*create_repository) (GgitCloneOptions  *options,
+                                             const gchar       *path,
+                                             gboolean           is_bare,
+                                             GError            **error);
 
-GgitCloneOptions          *ggit_clone_options_copy                (GgitCloneOptions        *clone_options);
-void                       ggit_clone_options_free                (GgitCloneOptions        *clone_options);
+       GgitRemote     *(*create_remote)     (GgitCloneOptions  *options,
+                                             GgitRepository    *repository,
+                                             const gchar       *name,
+                                             const gchar       *url,
+                                             GError            **error);
+
+};
+
+const git_clone_options  *_ggit_clone_options_get_native          (GgitCloneOptions        *options);
 
 GgitCloneOptions          *ggit_clone_options_new                 (void);
 
@@ -52,11 +65,13 @@ const gchar               *ggit_clone_options_get_checkout_branch (GgitCloneOpti
 void                       ggit_clone_options_set_checkout_branch (GgitCloneOptions        *options,
                                                                    const gchar             *checkout_branch);
 
-GgitFetchOptions          *ggit_clone_options_get_fetch_options   (GgitCloneOptions       *options);
-void                       ggit_clone_options_set_fetch_options   (GgitCloneOptions       *options,
-                                                                   GgitFetchOptions       *fetch_options);
+GgitCloneLocal             ggit_clone_options_get_local           (GgitCloneOptions        *options);
+void                       ggit_clone_options_set_local           (GgitCloneOptions        *options,
+                                                                   GgitCloneLocal           local);
 
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (GgitCloneOptions, ggit_clone_options_free)
+GgitFetchOptions          *ggit_clone_options_get_fetch_options   (GgitCloneOptions        *options);
+void                       ggit_clone_options_set_fetch_options   (GgitCloneOptions        *options,
+                                                                   GgitFetchOptions        *fetch_options);
 
 G_END_DECLS
 
diff --git a/libgit2-glib/ggit-remote.c b/libgit2-glib/ggit-remote.c
index da870bc..ab9a949 100644
--- a/libgit2-glib/ggit-remote.c
+++ b/libgit2-glib/ggit-remote.c
@@ -40,12 +40,6 @@ struct _GgitRemoteHead
        gint ref_count;
 };
 
-/**
- * GgitRemote:
- *
- * Represents a git remote.
- */
-
 G_DEFINE_TYPE (GgitRemote, ggit_remote, GGIT_TYPE_NATIVE)
 G_DEFINE_BOXED_TYPE (GgitRemoteHead, ggit_remote_head, ggit_remote_head_ref, ggit_remote_head_unref)
 
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index f02e253..ff9c2a8 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -164,11 +164,7 @@ ggit_repository_finalize (GObject *object)
        g_free (priv->url);
        g_clear_object (&priv->location);
        g_clear_object (&priv->workdir);
-
-       if (priv->clone_options != NULL)
-       {
-               ggit_clone_options_free (priv->clone_options);
-       }
+       g_clear_object (&priv->clone_options);
 
        repo = _ggit_native_get (object);
 
@@ -217,7 +213,7 @@ ggit_repository_get_property (GObject    *object,
                                            ggit_repository_get_head (repository, NULL));
                        break;
                case PROP_CLONE_OPTIONS:
-                       g_value_set_boxed (value, priv->clone_options);
+                       g_value_set_object (value, priv->clone_options);
                        break;
                default:
                        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -296,7 +292,7 @@ ggit_repository_set_property (GObject      *object,
                        priv->init = g_value_get_boolean (value);
                        break;
                case PROP_CLONE_OPTIONS:
-                       priv->clone_options = g_value_dup_boxed (value);
+                       priv->clone_options = g_value_dup_object (value);
                        break;
                default:
                        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -373,12 +369,12 @@ ggit_repository_class_init (GgitRepositoryClass *klass)
 
        g_object_class_install_property (object_class,
                                         PROP_CLONE_OPTIONS,
-                                        g_param_spec_boxed ("clone-options",
-                                                            "Clone options",
-                                                            "Clone options",
-                                                            GGIT_TYPE_CLONE_OPTIONS,
-                                                            G_PARAM_READWRITE |
-                                                            G_PARAM_CONSTRUCT_ONLY));
+                                        g_param_spec_object ("clone-options",
+                                                             "Clone options",
+                                                             "Clone options",
+                                                             GGIT_TYPE_CLONE_OPTIONS,
+                                                             G_PARAM_READWRITE |
+                                                             G_PARAM_CONSTRUCT_ONLY));
 }
 
 static void
@@ -427,7 +423,7 @@ ggit_repository_initable_init (GInitable    *initable,
                err = git_clone (&repo,
                                 priv->url,
                                 path,
-                                _ggit_clone_options_get_clone_options (priv->clone_options));
+                                _ggit_clone_options_get_native (priv->clone_options));
        }
        else
        {
diff --git a/libgit2-glib/ggit-types.c b/libgit2-glib/ggit-types.c
index 3a31023..03abbb3 100644
--- a/libgit2-glib/ggit-types.c
+++ b/libgit2-glib/ggit-types.c
@@ -287,4 +287,9 @@ ASSERT_ENUM (GGIT_CREDTYPE_SSH_INTERACTIVE, GIT_CREDTYPE_SSH_INTERACTIVE);
 ASSERT_ENUM (GGIT_DIRECTION_FETCH, GIT_DIRECTION_FETCH);
 ASSERT_ENUM (GGIT_DIRECTION_PUSH, GIT_DIRECTION_PUSH);
 
+ASSERT_ENUM (GGIT_CLONE_LOCAL_AUTO, GIT_CLONE_LOCAL_AUTO);
+ASSERT_ENUM (GGIT_CLONE_LOCAL_LOCAL, GIT_CLONE_LOCAL);
+ASSERT_ENUM (GGIT_CLONE_LOCAL_NO_LOCAL, GIT_CLONE_NO_LOCAL);
+ASSERT_ENUM (GGIT_CLONE_LOCAL_NO_LINKS, GIT_CLONE_LOCAL_NO_LINKS);
+
 /* ex:set ts=8 noet: */
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index 1cc1c0c..32dd01b 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -201,6 +201,13 @@ typedef struct _GgitReflogEntry GgitReflogEntry;
 typedef struct _GgitRemoteHead GgitRemoteHead;
 
 /**
+ * GgitRemote:
+ *
+ * Represents a git remote.
+ */
+typedef struct _GgitRemote GgitRemote;
+
+/**
  * GgitRepository:
  *
  * Represents an existing git repository including all of it's
@@ -939,6 +946,14 @@ typedef enum
        GGIT_DIRECTION_PUSH  = 1
 } GgitDirection;
 
+typedef enum
+{
+       GGIT_CLONE_LOCAL_AUTO     = 0,
+       GGIT_CLONE_LOCAL_LOCAL    = 1,
+       GGIT_CLONE_LOCAL_NO_LOCAL = 2,
+       GGIT_CLONE_LOCAL_NO_LINKS = 3
+} GgitCloneLocal;
+
 /**
  * GgitConfigCallback:
  * @entry: a #GgitConfigEntry.



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