+ // find unused remotes.. and track them...
+ foreach(var rn in remotes_used.keys) {
+ if (remotes_used.get(rn)) {
+ continue;
+ }
+ if (repo.branches.has_key(rn)) {
+ GLib.debug("skip tracking branch - same name exists?");
+ continue;
+ }
+ // not clear how to do this yet...
+ try {
+ repo.git( { "branch" ,"--track" , rn, "origin/" + rn} );
+ } catch (Error e) {
+ continue; // allow failure?
+ }
+ var br = new GitBranch(repo);
+ br.name = rn;
+ br.lastrev = ""; // it's behind
+ br.remoterev = remotes.get(rn).to_string();
+ br.remote = rn;
+ br.ahead = 0;
+ br.behind = 1;
+ // behind/ahead == 0...
+ repo.branches.set(rn, br);
+
+ }
+ if (repo.currentBranch == null) {
+ GLib.error("could not find active Branch for %s", repo.name);
+ }