Git.vala
[gitlive] / Git.vala
index 02c0669..2e7a0e1 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -22,12 +22,12 @@ void main()
        var a = new GitLive.Repo("/home/alan/gitlive/gitlive");
        //a.mergeMasterIntoHead();
        //a.walkDiff();
-       return;
-       a.is_managed();
-       a.is_autocommit();
+       //return;
+       //a.is_managed();
+       //a.is_autocommit();
        a.loadLocalBranches();
        a.loadRemoteHeads();
-       a.fetchAll();
+       //a.fetchAll();
        //
        /*
        var a = new GitLive.Repo("/home/alan/git/test1-clone");
@@ -56,7 +56,7 @@ void main()
        //string[] spawn_env = Environ.get ();
 //     Process.spawn_sync ("/home/alan/git/test1-clone", spawn_args, spawn_env, SpawnFlags.SEARCH_PATH, null);
  
-       a.pushAll();
+       //a.pushAll();
 }
  
 
@@ -90,9 +90,10 @@ namespace  GitLive {
                                var br = r.get() as Ggit.Branch;
                                //var head = this.repo.revparse("refs/heads/" + br.get_name() ).get_id();
                                //var rhead = this.repo.revparse(br.get_upstream().get_name() ).get_id();
-                                 GLib.debug("got branch: name = %s upstream = %s oid = %s ", 
+                           GLib.debug("got branch: H=%s name = %s upstream = %s oid = %s ", 
+                                               br.is_head() ? "Y" : "n",
                                                br.get_name(), br.get_upstream().get_name(), 
-                                       head.to_string());
+                                           br.get_target().to_string());
                                this.branches.add(br);
                                if (br.is_head()) {
                                        GLib.debug("HEAD= %s", br.get_name());
@@ -293,10 +294,22 @@ namespace  GitLive {
                        var r = this.repo.lookup_remote("origin");
                        r.connect(Ggit.Direction.FETCH, this.callbacks, null, null);
                        this.remote_heads = r.list();
-               
+                       
+                       foreach(var br in this.remote_heads) {
+                               if (!br.get_name().has_prefix("refs/heads/")) {
+                                       continue;
+                               }
+                               
+                               GLib.debug("Remote: name=%s  oid=%s local_oid=%s is_local=%s",
+                                       br.get_name().substring(11),
+                                       br.get_oid().to_string(),
+                                       br.get_local_oid().to_string(),
+                                       br.is_local() ? "Y" : "n"
+                                       );
+                                       }
+                       
                }
-               
-               
+                
                
                Ggit.Branch? getBranch(string remote_name, string remote_branch_name)
                {