Ggit.init();
var a = new GitLive.Repo("/home/alan/gitlive/gitlive");
+ a.loadBranches();
a.fetchAll();
- //a.branches();
+ //
/*
var a = new GitLive.Repo("/home/alan/git/test1-clone");
//a.fetchAll();
}
Gee.ArrayList<Ggit.Branch> branches = null;
- public Gee.ArrayList<Ggit.Branch> loadBranches()
+ public void loadBranches()
{
- this.branches new Gee.ArrayList<Ggit.Branch>();
+ this.branches = new Gee.ArrayList<Ggit.Branch>();
var r = this.repo.enumerate_branches(Ggit.BranchType.LOCAL);
}
- return ret;
+
}
- Ggit.Branch? getBranch(string remote_name)
+ Ggit.Branch? getBranch(string remote_name, string remote_branch_name)
{
+ GLib.debug("lookup %s:%s", remote_name, remote_branch_name);
foreach(var br in this.branches) {
- if (br.get_upstream().get_name() == remote_name) {
+ GLib.debug("test:%s=%s", "refs/remotes/" + br.get_upstream().get_shorthand() , remote_branch_name);
+ if ("refs/remotes/" + br.get_upstream().get_shorthand() == remote_branch_name) {
return br;
}
+
}
+ //GLib.debug("missing %s", remote_branch_name);
return null;
}
var heads = r.list();
foreach(var rh in heads) {
- var br = this.getBranch(rh.get_name());
+ var br = this.getBranch(n, rh.get_shorthand());
GLib.debug("got heads: name=%s rev=%s localrev=%s",
rh.get_name(),