GitRepo.vala
[gitlive] / Git.vala
index f892346..a1f3b4c 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -16,8 +16,10 @@ void main()
             }
          ); 
 
+       
        Ggit.init();
-       var a = new GitLive.Repo("/home/alan/gitlive/web.coba");
+       var a = new GitLive.Repo("/home/alan/gitlive/gitlive");
+       a.diffhead();
        a.fetchAll();
        return;
        /*
@@ -219,6 +221,25 @@ namespace  GitLive {
                        
                        
                }
+               
+               public void diffhead()
+               {
+                       var r = this.repo.enumerate_branches(Ggit.BranchType.LOCAL);
+                       Ggit.Branch head;
+                       while (r.next()) {
+                               var gbr = r.get() as Ggit.Branch;
+                               if (gbr.is_head()) {
+                                       head = gbr;
+                               }
+                       }
+                       GLib.debug("checking head=%s", head.get_name());
+                       var br = this.repo.lookup_branch(head.get_name(),Ggit.BranchType.LOCAL);
+                       var tree =  this.repo.lookup_tree(br.get_target());
+                       
+                       
+               }
+               
+               
                public void mergeMasterIntoHead()
                {
                        // assumes head is not master...
@@ -271,6 +292,9 @@ namespace  GitLive {
                }
                
                
+
+               
+               
                /*
                public bool doMergeClose(string commit_message)
                {