sync
authorAlan <alan@roojs.com>
Sun, 10 Mar 2019 01:24:33 +0000 (09:24 +0800)
committerAlan <alan@roojs.com>
Sun, 10 Mar 2019 01:24:33 +0000 (09:24 +0800)
Git.vala

index 8f9483a..d4d06c8 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -18,7 +18,7 @@ void main()
          ); 
 
        Ggit.init();
-       var a = new GitLive.Repo("/home/alan/gitlive/web.Texon");
+       var a = new GitLive.Repo("/home/alan/gitlive/gitlive");
        a.fetchAll();
        a.pushAll();
 }
@@ -92,18 +92,25 @@ namespace  GitLive {
                                        GLib.debug("Got Error Message: %s", e.message);
                                        return;
                                }
-                               GLib.debug("getting specs '%s'", n);
-
-
+                               //GLib.debug("getting specs '%s'", n);
+                                
+                               var head = this.repo.get_head();
+                               this.repo.add_remote_push(
+                                       "origin",
+                                       "+%s:%s".printf(head.get_shorthand(),head.get_name())
+                               );
                                var far = r.get_push_specs();
                                
                                foreach(var rs in far) {
                                        GLib.debug("got remote spec: %s", rs);
                                        
                                }
+                                       
                                var popts = new Ggit.PushOptions();
+                               //popts.callbacks = this.callbacks;
                                GLib.debug("Push?");
-                               r.upload(far, popts);
+                               r.upload(null,popts);
                                GLib.debug("Push done?");
                                r.disconnect();
                                
@@ -215,7 +222,7 @@ namespace  GitLive {
                        var lines = str.split("\n");
                        for(var i=0; i< lines.length; i++) {
                                // assumes one line per entry.. if not we are buggered...
-                               GLib.debug("got %s" , lines[i]);
+                               //GLib.debug("got %s" , lines[i]);
                        
                                var bits =  Regex.split_simple ("[ \t]+", lines[i].strip());
                                if (bits.length < 6 || bits[0] != "machine" || bits[1] != domain) {