[gnome-builder/gnome-builder-3-32] gui: set fallback VCS if no VCS was loaded



commit 5a0bcd9fb23890fd24aee47468f3a360a943f398
Author: Christian Hergert <chergert redhat com>
Date:   Sat Apr 27 12:09:39 2019 -0700

    gui: set fallback VCS if no VCS was loaded
    
    The recursive GFileMonitor only get setup after we discover the VCS
    working-directory. If no VCS was discovered, we never get the workdir
    to set that up.
    
    This checks, after loading a project, if we discovered a VCS and ensures
    we have the fallback VCS if needed.
    
    Fixes #896

 src/libide/gui/ide-workbench.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/libide/gui/ide-workbench.c b/src/libide/gui/ide-workbench.c
index 83c11cc29..35aa809f2 100644
--- a/src/libide/gui/ide-workbench.c
+++ b/src/libide/gui/ide-workbench.c
@@ -981,6 +981,17 @@ ide_workbench_load_project_completed (IdeWorkbench *self,
   g_assert (lp->addins != NULL);
   g_assert (lp->addins->len == 0);
 
+  /* If we did not get a VCS as part of the loading process, set the
+   * fallback VCS implementation.
+   */
+  if (self->vcs == NULL)
+    {
+      g_autoptr(GFile) workdir = ide_context_ref_workdir (self->context);
+      g_autoptr(IdeDirectoryVcs) vcs = ide_directory_vcs_new (workdir);
+
+      ide_workbench_set_vcs (self, IDE_VCS (vcs));
+    }
+
   if (lp->workspace_type != G_TYPE_INVALID)
     {
       IdeWorkspace *workspace;


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