}
- public delegate void GitAsyncCallback (string str);
- public string pull_async(GitAsyncCallback cb)
+ public delegate void GitAsyncCallback (GitRepo repo, string str);
+ public void pull_async(GitAsyncCallback cb)
{
string[] cmd = { "pull" , "--no-edit" };
- return this.git_async( cmd , cb);
+ this.git_async( cmd , cb);
+
}
return sp.output;
}
-
- public string git_async( string[] args_in, GitAsyncCallback cb ) throws Error, SpawnError
+ unowned GitAsyncCallback git_async_on_callback;
+ public void git_async( string[] args_in, GitAsyncCallback cb ) throws Error, SpawnError
{
// convert arguments.
-
+ this.git_async_on_callback = cb;
string[] args = { "git" };
//args += "--git-dir";
//args += this.gitdir;
// may throw error...
var sp = new Spawn(cfg);
- cfg.onFinish((err) {
- cb(sp.output);
- });
- stdout.printf( "GOT: %s\n" , sp.output);
- // parse output for some commands ?
- return sp.output;
+ //sp.ref();
+ //this.ref();
+ sp.run(this.git_async_on_complete);
+
}
+
+ void git_async_on_complete(int err, string output)
+ {
+ print("GOT %s\n", output);
+ this.git_async_on_callback(this, output);
+// this.unref();
+ // sp.unref();
+
+
+ }
+
}