GitMonitor.vala
[gitlive] / GitMonitor.vala
index 4d51102..4c7dfde 100644 (file)
@@ -241,6 +241,7 @@ public class GitMonitor : Monitor
 
                this.paused = true;
 
+               var leave_queued = new Gee.ArrayList<GitMonitorQueue>();
                GLib.debug("GitMonitor.runQueue - creating repos");
                
                for(var i = 0; i < cmds.length; i++) {
@@ -250,13 +251,14 @@ public class GitMonitor : Monitor
                        var gitpath = cmd.gitpath; 
                        
                        var repo = GitRepo.get( gitpath );
-                       if ( !repo.isWipBranch()) {
+                       if ( !repo.is_wip_branch()) {
+                               leave_queued.add(cmd);
                                continue;
                        }
                        
                        GLib.debug("GitMonitor.runQueue - finding %s", cmd.gitpath);
                
-                       var ix  = GitRepo.indexOf(repo_list,  cmd.gitpath);
+                       var ix  = GitRepo.indexOf(repo_list,   gitpath);
                        if (ix < 0) {
                                repo_list.append_val( GitRepo.get( gitpath ));
                                ix = GitRepo.indexOf(repo_list,  cmd.gitpath);
@@ -329,6 +331,9 @@ public class GitMonitor : Monitor
                                                break;
                                } 
                        }
+                       
+                       repo.cmds.clear();
+                       
                        GLib.debug( "ADD : %s", GitMonitorQueue.queueArrayToString(add_files));
                        GLib.debug( "REMOVE FILES: %s", GitMonitorQueue.queueArrayToString(remove_files));