X-Git-Url: http://git.roojs.org/?p=gitlive;a=blobdiff_plain;f=GitBranch.vala;fp=GitBranch.vala;h=84a833129db97fb0d3722dedf5114407cf1d396f;hp=a30808be43dba4807a3ba13e35fd978839d5dd79;hb=d33736b91e5bdee2a751dce3d4199d22244ca786;hpb=206d52640d8503c5fab3b90899fff6827eb1adbe diff --git a/GitBranch.vala b/GitBranch.vala index a30808be..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; @@ -111,8 +111,23 @@ public class GitBranch : Object branches.get(rname).name = lname; } - foreach(var br in local.values) { + 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/",""); + if (branches.has_key(newname)) { + GLib.debug("SKIP - have branch already"); + continue; + } + + + repo.git( { "branch" ,"--track" , newname, "origin/" + newname} ); + // + br.name = newname; + local.set(br.name, br); } /*