[gnome-builder/gnome-builder-3-38] Default to cloning remote's HEAD branch



commit 0c69d7713d6de30fb2a6e126c1506d8f3da4f8da
Author: Sophie Herold <sophie hemio de>
Date:   Tue Nov 3 01:18:38 2020 +0100

    Default to cloning remote's HEAD branch
    
    Closes #1312

 src/libide/greeter/ide-clone-surface.c        | 3 +--
 src/libide/greeter/ide-clone-surface.ui       | 1 -
 src/plugins/git/daemon/ipc-git-service-impl.c | 3 +++
 src/plugins/git/gbp-git-vcs-cloner.c          | 4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/libide/greeter/ide-clone-surface.c b/src/libide/greeter/ide-clone-surface.c
index 5e608b27d..f21089b75 100644
--- a/src/libide/greeter/ide-clone-surface.c
+++ b/src/libide/greeter/ide-clone-surface.c
@@ -560,8 +560,7 @@ ide_clone_surface_clone (IdeCloneSurface *self)
   path = g_file_peek_path (self->destination);
   branch = gtk_entry_get_text (self->branch_entry);
 
-  if (!ide_str_empty0 (branch))
-    g_variant_dict_insert (&dict, "branch", "s", branch);
+  g_variant_dict_insert (&dict, "branch", "s", branch);
 
   if (!ide_str_empty0 (author) && !g_str_equal (g_get_real_name (), author))
     g_variant_dict_insert (&dict, "user.name", "s", author);
diff --git a/src/libide/greeter/ide-clone-surface.ui b/src/libide/greeter/ide-clone-surface.ui
index f1f3bc441..57bb684c4 100644
--- a/src/libide/greeter/ide-clone-surface.ui
+++ b/src/libide/greeter/ide-clone-surface.ui
@@ -179,7 +179,6 @@
                               <object class="GtkEntry" id="branch_entry">
                                 <property name="visible">true</property>
                                 <property name="valign">center</property>
-                                <property name="text">master</property>
                               </object>
                               <packing>
                                 <property name="row">1</property>
diff --git a/src/plugins/git/daemon/ipc-git-service-impl.c b/src/plugins/git/daemon/ipc-git-service-impl.c
index 013c1af37..688128bb1 100644
--- a/src/plugins/git/daemon/ipc-git-service-impl.c
+++ b/src/plugins/git/daemon/ipc-git-service-impl.c
@@ -180,6 +180,9 @@ ipc_git_service_impl_handle_clone (IpcGitService         *service,
 
   file = g_file_new_for_path (location);
 
+  if (!*branch)
+    branch = NULL;
+
   callbacks = ipc_git_remote_callbacks_new (progress);
 
   fetch_options = ggit_fetch_options_new ();
diff --git a/src/plugins/git/gbp-git-vcs-cloner.c b/src/plugins/git/gbp-git-vcs-cloner.c
index d7caedc87..9feb5a922 100644
--- a/src/plugins/git/gbp-git-vcs-cloner.c
+++ b/src/plugins/git/gbp-git-vcs-cloner.c
@@ -226,7 +226,7 @@ gbp_git_vcs_cloner_clone_async (IdeVcsCloner        *cloner,
   /* Extract branch, leave other options to pass-through */
   g_variant_dict_init (&dict, options);
   if (!g_variant_dict_lookup (&dict, "branch", "&s", &branch))
-    branch = "master";
+    branch = "";
   g_variant_dict_remove (&dict, "branch");
 
   /* Make sure we have a real URI to connect to */
@@ -268,7 +268,7 @@ gbp_git_vcs_cloner_clone_async (IdeVcsCloner        *cloner,
   ipc_git_service_call_clone (service,
                               uristr,
                               g_file_peek_path (req->location),
-                              req->branch ?: "master",
+                              req->branch ?: "",
                               g_variant_dict_end (&dict),
                               g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON 
(req->progress)),
                               cancellable,


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