[gnome-builder] git: only notify when branch name changed



commit 559eb850a5706a4e8577247698fd6cb058e3b9e8
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 12 12:56:19 2019 -0800

    git: only notify when branch name changed
    
    This avoids over-notifying about the branch-name property. This way it can
    be used to invalidate the build pipeline since the branch name is used
    in directory paths there.

 src/plugins/git/gbp-git-vcs.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/git/gbp-git-vcs.c b/src/plugins/git/gbp-git-vcs.c
index 2627a8117..aee3d522f 100644
--- a/src/plugins/git/gbp-git-vcs.c
+++ b/src/plugins/git/gbp-git-vcs.c
@@ -832,9 +832,12 @@ gbp_git_vcs_reload_finish (GbpGitVcs     *self,
 
       if (name != NULL)
         {
-          g_free (self->branch);
-          self->branch = g_strdup (name);
-          g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_BRANCH_NAME]);
+          if (!ide_str_equal0 (name, self->branch))
+            {
+              g_free (self->branch);
+              self->branch = g_strdup (name);
+              g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_BRANCH_NAME]);
+            }
         }
     }
 


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