GitRepo.vala
[gitlive] / GitRepo.vala
index e39e8e2..ea4d1e0 100644 (file)
@@ -274,11 +274,12 @@ public class GitRepo : Object
         
     }
     
-    public delegate void GitAsyncCallback (string str)
-    async public string pull_async(GitAsyncCallback cb) {
+    public delegate void GitAsyncCallback (string str);
+    public string pull_async(GitAsyncCallback cb) 
+    {
     
-          string[] cmd = { "pull" , "--no-edit" };
-        return this.git( cmd , cb);
+        string[] cmd = { "pull" , "--no-edit" };
+        return this.git_async( cmd , cb);
     
     }
     
@@ -352,7 +353,7 @@ public class GitRepo : Object
     }
        
        
-       public string git_async(GitAsyncCallback cb, string[] args_in ) throws Error, SpawnError
+       public   git_async( string[] args_in,   GitAsyncCallback cb ) throws Error, SpawnError
     {
         // convert arguments.
         
@@ -391,11 +392,9 @@ public class GitRepo : Object
 
        // may throw error...
         var sp = new Spawn(cfg);
-        cfg.onFinish((err) {
-               cb(sp.output);
+        sp.run((err, output) => {
+               cb(output);
         });
-        stdout.printf( "GOT: %s\n" , sp.output);
-        // parse output for some commands ?
-        return sp.output;
+         
     }
 }