X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=GitBranch.vala;h=c08721be57d61f4f40d04258b30c13585676d8f0;hb=556661ee18a4b114d63e652935773a54362a4af1;hp=e9964922c156b7a133061bdb9b643b1734dafc0f;hpb=c1ad70290a106c4ba503d1cd77494fbde6cf965d;p=gitlive diff --git a/GitBranch.vala b/GitBranch.vala index e9964922..c08721be 100644 --- a/GitBranch.vala +++ b/GitBranch.vala @@ -117,15 +117,22 @@ public class GitBranch : Object br.remoterev = remotes.get(rname).to_string(); remotes_used.set(rname,true); size_t ahead, behind; - repo.repo.get_ahead_behind( - gbr.get_target(), - remotes.get(rname), - out ahead, - out behind - ); - br.ahead = (int)ahead; - br.behind = (int) behind; + br.behind = 1; + + try { + repo.repo.get_ahead_behind( + gbr.get_target(), + remotes.get(rname), + out ahead, + out behind + ); + br.ahead = (int)ahead; + br.behind = (int) behind; + } catch(Error e) { + GLib.debug("we probably need to fetch... %s", repo.name); + } + } @@ -134,7 +141,7 @@ public class GitBranch : Object } if (br.active) { GLib.debug("repo: %s currentBranch = %s", repo.name, br.name); - repo.currentBranch = br; + repo._currentBranch = br; } } @@ -165,7 +172,8 @@ public class GitBranch : Object repo.branches.set(rn, br); } - if (repo.currentBranch == null) { + + if (repo._currentBranch == null) { GLib.error("could not find active Branch for %s", repo.name); }