[libgit2-glib] Conditionally support SSH in clone example



commit 99dbdc104e087c83776c3502d71396862d2c6b1c
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Tue Aug 4 18:01:21 2015 +0200

    Conditionally support SSH in clone example

 examples/clone.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/examples/clone.c b/examples/clone.c
index 3171b36..337250f 100644
--- a/examples/clone.c
+++ b/examples/clone.c
@@ -66,7 +66,9 @@ chomp (gchar *s)
        }
 }
 
+#ifdef GIT_SSH
 static gboolean tried_ssh_key = FALSE;
+#endif
 
 static GgitCred *
 cloner_credentials (GgitRemoteCallbacks  *callbacks,
@@ -82,11 +84,13 @@ cloner_credentials (GgitRemoteCallbacks  *callbacks,
 
        g_return_val_if_fail (error != NULL && *error == NULL, NULL);
 
+#ifdef GIT_SSH
        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));
        }
+#endif
 
        g_printf ("Username: ");
 



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