Fix #5613 - gitlive - view tickets
[gitlive] / GitMonitor.vala
index c739d62..7e42154 100644 (file)
@@ -54,13 +54,19 @@ public class GitMonitor : Monitor
                        if (this.queue.size < 1  || this.queueRunning) {
                                return true;
                        }
+                       var first = this.queue.get(0);
+                       var delay = true;
+                       if (!first.repo.is_wip_branch() && first.repo.is_auto_branch()) {
+                               delay = false;
+                       }
+                       
                        
                        var last = -1 * this.lastAdd.difference(new DateTime.now(new TimeZone.local()));
  
                        // stdout.printf("LAST RUN: %s (expect %s) \n" ,
                        //         last.to_string(),   (5 * TimeSpan.SECOND).to_string() );
  
-                       if (last < 5 * TimeSpan.SECOND) { // wait 5 seconds before running. ????
+                       if (delay && last < 5 * TimeSpan.SECOND) { // wait 5 seconds before running. ????
                                return true;
                        }
                        //_this.lastAdd = new Date();
@@ -262,7 +268,7 @@ public class GitMonitor : Monitor
                
                 
                
-               GLib.debug("GitMonitor.runQueue\n");
+               GLib.debug("GitMonitor.runQueue size =%d\n", this.queue.size);
 
                this.queueRunning = true;
 
@@ -299,7 +305,7 @@ public class GitMonitor : Monitor
                        var gitpath = cmd.gitpath; 
                        
                        var repo = GitRepo.get( gitpath );
-                       if ( !repo.is_wip_branch()) {
+                       if ( !repo.is_wip_branch() && repo.is_auto_branch()) {
                                leave_queued.add(cmd);
                                continue;
                        }