GitRepo.vala
authorAlan Knowles <alan@roojs.com>
Wed, 20 Mar 2019 10:30:50 +0000 (18:30 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 20 Mar 2019 10:30:50 +0000 (18:30 +0800)
GitRepo.vala

index b22571c..13804e1 100644 (file)
@@ -960,14 +960,24 @@ public class GitRepo : Object
     {
        // update the branches..
        this.loadBranches();
-       var r = this.repo.lookup_remote("origin");
+
                //GLib.debug("connecting '%s'", r.get_url());
-                
-               try {
-                       string[] h = { "a = 1" };
-                       r.connect(Ggit.Direction.FETCH, this.callbacks, null, null);
+               string[] far = {}
+               foreach(var br in this.branches.values) {
+                       if (br.remote == "" || br.remoterev == br.lastrev) {
+                               continue;
+                       }
+                       far +=  ("+refs/heads/" + br.name + ":refs/remotes/" + br.remote);
+               }
+               if (far.length > 0) {
+               var r = this.repo.lookup_remote("origin");
                        r.connect(Ggit.Direction.FETCH, new GitCallbacks, null, null);
+                       var options = new Ggit.FetchOptions();
+                       //options.set_remote_callbacks(this.callbacks);
+                   r.download(far, options);
+                               //});
     
+       
     }