From a18f1e6390db1502e8954fb7d692fbe5c5de3207 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 15 Jan 2019 17:10:05 +0800 Subject: [PATCH] Uncommited changes synced --- GitBranch.vala | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/GitBranch.vala b/GitBranch.vala index bd4be49d..84a83312 100644 --- a/GitBranch.vala +++ b/GitBranch.vala @@ -103,7 +103,7 @@ public class GitBranch : Object branches.get(lname).remote = rname; } - if (!branches.has_key(rname)) { + if (!branches.has_key(rname) || !branches.has_key(lname) ) { continue; } branches.get(lname).remoterev = branches.get(rname).lastrev; @@ -112,15 +112,22 @@ public class GitBranch : Object branches.get(rname).name = lname; } foreach(var br in branches.values) { + GLib.debug("BRANCH:\n%s\n" , br.toString()); if (br.name.length > 0 || ! /^remotes\/origin\//.match(br.remote)) { + GLib.debug("SKIP - track exists"); continue; } - var newname = br.remote.replace("/remotes/origin/",""); + var newname = br.remote.replace("remotes/origin/",""); if (branches.has_key(newname)) { - continue; + GLib.debug("SKIP - have branch already"); + continue; } - repo.get( { "branch" ,"--track", newname, "origin/" + newname} ); - //GLib.debug("BRANCH:\n%s\n" , br.toString()); + + + repo.git( { "branch" ,"--track" , newname, "origin/" + newname} ); + // + br.name = newname; + local.set(br.name, br); } /* -- 2.39.2