From 8cb1c65bc51ba6344608c7b80b3fd9bd55b798fb Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 5 Sep 2014 11:55:10 +0800 Subject: [PATCH] GitMonitor.vala --- GitMonitor.vala | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/GitMonitor.vala b/GitMonitor.vala index 09e2886c..6a672884 100644 --- a/GitMonitor.vala +++ b/GitMonitor.vala @@ -123,6 +123,24 @@ public class GitMonitorQueue : MonitorNamePathDir { return ret; } + + public static bool GitMonitorQueue.queueHas(Array list , GitMonitorQueue cmd_s, string action)) { + for(var i =0; i < list.length; i++) { + var test = list.index(i); + if (list.index(i).gitpath != cmd_s.gitpath) { + continue + } + if (list.index(i).vname != cmd_s.vname) { + continue + } + if (list.index(i).action != action) { + continue + } + return true; + } + return false; + } + } @@ -695,7 +713,7 @@ public class GitMonitor : Monitor var cmd = new GitMonitorQueue(dest); cmd.action = "commit"; cmd.message = "MOVED " + cmd_s.vname + " to " + cmd_d.vname; - if (GitMonitorQueue.queueHas(cmd_s, "add")) { + if (GitMonitorQueue.queueHas(this.queue, cmd_s, "add")) { cmd.message = cmd_d.vname; } -- 2.39.2