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



commit f5cd5fe3543168b534f438ed2a1d4ea9f35e61fa
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]