[gnome-builder] plugins/git: watch for file moves



commit 08ef1244a0b9acebe8265008e281eff6930735ea
Author: Christian Hergert <chergert redhat com>
Date:   Mon Sep 26 16:33:51 2022 -0700

    plugins/git: watch for file moves
    
    This just allows us to see files a bit more clearly with what is going on,
    but also requires that we check other_file for things we care about.

 src/plugins/git/daemon/ipc-git-index-monitor.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/git/daemon/ipc-git-index-monitor.c b/src/plugins/git/daemon/ipc-git-index-monitor.c
index 070e92b6a..7f15a23a5 100644
--- a/src/plugins/git/daemon/ipc-git-index-monitor.c
+++ b/src/plugins/git/daemon/ipc-git-index-monitor.c
@@ -150,6 +150,14 @@ ipc_git_index_monitor_dot_git_changed_cb (IpcGitIndexMonitor *self,
   if (g_hash_table_contains (index_changed_files, name))
     goto queue_changed_signal;
 
+  if (other_file != NULL)
+    {
+      g_autofree char *other_name = g_file_get_basename (other_file);
+
+      if (g_hash_table_contains (index_changed_files, other_name))
+        goto queue_changed_signal;
+    }
+
   return;
 
 queue_changed_signal:
@@ -209,7 +217,7 @@ ipc_git_index_monitor_new (GFile *location)
     }
 
   self->dot_git_monitor = g_file_monitor_directory (dot_git_dir,
-                                                    G_FILE_MONITOR_NONE,
+                                                    G_FILE_MONITOR_WATCH_MOVES,
                                                     NULL,
                                                     &error);
 


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