GitRepo.vala
authorAlan Knowles <alan@roojs.com>
Wed, 20 Mar 2019 06:44:38 +0000 (14:44 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 20 Mar 2019 06:44:38 +0000 (14:44 +0800)
GitRepo.vala

index 9db05e2..6f669c2 100644 (file)
@@ -32,6 +32,7 @@ public class GitRepo : Object
     public Gee.HashMap<string,string> config_cache;
     
     public Ggit.Repository repo;
+    public Ggit.RemoteHead[]                           remote_heads = null;
     
        public static GitRepo singleton()
     {
@@ -981,6 +982,16 @@ public class GitRepo : Object
                return;
     }
     
-    
+    public void loadRemoteHeads(bool force = false)
+               {
+                       
+                       if (!force && this.remote_heads != null) {
+                               return;
+                       }
+                       var r = this.repo.lookup_remote("origin");
+                       r.connect(Ggit.Direction.FETCH, this.callbacks, null, null);
+                       this.remote_heads = r.list();
+               
+               }
     
 }