X-Git-Url: http://git.roojs.org/?p=gitlive;a=blobdiff_plain;f=GitMonitor.vala;h=1b11558f03dba3a900904694d23f1078d44e3f51;hp=798971c49438b46d9935dca0bee8c2382c88848b;hb=62bcbeee7e77f9f8774f13569dc9fb5cc25666d6;hpb=43b29bb4bbe76f64630ebfbdc6cc77aa61960058 diff --git a/GitMonitor.vala b/GitMonitor.vala index 798971c4..1b11558f 100644 --- a/GitMonitor.vala +++ b/GitMonitor.vala @@ -54,13 +54,21 @@ public class GitMonitor : Monitor if (this.queue.size < 1 || this.queueRunning) { return true; } + var first = this.queue.get(0); + var delay = true; + + // eg. on master.... and is_auto branch + if (first.repo.is_master_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(); @@ -250,7 +258,7 @@ public class GitMonitor : Monitor } foreach(var q in this.queue) { - if (!q.shouldIgnore() && !q.repo.is_wip_branch() && q.repo.is_auto_branch()) { + if (!q.shouldIgnore() && q.repo.is_master_branch() && q.repo.is_auto_branch()) { var oldq = this.queue; this.queue = new Gee.ArrayList(); NewBranch.singleton().show(q.repo, oldq); @@ -299,7 +307,7 @@ public class GitMonitor : Monitor var gitpath = cmd.gitpath; var repo = GitRepo.get( gitpath ); - if ( !repo.is_wip_branch() && repo.is_auto_branch()) { + if ( repo.is_master_branch() && repo.is_auto_branch()) { leave_queued.add(cmd); continue; }