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)
{
+ GLib.debug("lookup %s", remote_name);
foreach(var br in this.branches) {
if (br.get_upstream().get_name() == remote_name) {
return br;
}
+
}
return null;
}
+
public void fetchAll()
{
// remotes probably will not work with http auth..
var heads = r.list();
foreach(var rh in heads) {
- rh.get_shotor_name(),
+ var br = this.getBranch(rh.get_name());
GLib.debug("got heads: name=%s rev=%s localrev=%s",
rh.get_name(),
rh.get_oid().to_string(),
- rh.get_local_oid().to_string()
+ br == null ? "?": this.repo.revparse(br.get_name() ).get_id().to_string()
);
}