Git.vala
authorAlan Knowles <alan@roojs.com>
Thu, 7 Mar 2019 07:58:52 +0000 (15:58 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 7 Mar 2019 07:58:52 +0000 (15:58 +0800)
Git.vala

index ea7c8f8..561ed91 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -68,6 +68,42 @@ namespace  Git {
                                
                                
                                
+                               //r.download(
+                       }
+               
+               }
+               public void pushAll()
+               {
+                       // remotes probably will not work with http auth..
+                       var ar = this.repo.list_remotes();
+                       foreach(var n in ar) {
+                               GLib.debug("got remote '%s'", n);
+                               var r = this.repo.lookup_remote(n);
+                               GLib.debug("connecting '%s'", r.get_url());
+                                
+                               try {
+                                       string[] h = { "a = 1" };
+                                       r.connect(Ggit.Direction.PUSH, this.callbacks, null, null);
+                                       
+                               } catch (Error e) {
+                                       GLib.debug("Got Error Message: %s", e.message);
+                                       return;
+                               }
+                               GLib.debug("getting specs '%s'", n);
+
+
+                               var far = r.get_fetch_specs();
+                               
+                               foreach(var rs in far) {
+                                       GLib.debug("got remote spec: %s", rs);
+                                       
+                               }
+                               var options = new Ggit.FetchOptions();
+                               options.set_remote_callbacks(this.callbacks);
+                               r.download(far, options);
+                               
+                               
+                               
                                //r.download(
                        }