projects
/
gitlive
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
49462b1
)
GitRepo.vala
author
Alan Knowles
<alan@roojs.com>
Wed, 27 Sep 2017 06:31:18 +0000
(14:31 +0800)
committer
Alan Knowles
<alan@roojs.com>
Wed, 27 Sep 2017 06:31:18 +0000
(14:31 +0800)
GitRepo.vala
patch
|
blob
|
history
diff --git
a/GitRepo.vala
b/GitRepo.vala
index
a31935f
..
d69a112
100644
(file)
--- a/
GitRepo.vala
+++ b/
GitRepo.vala
@@
-274,12
+274,13
@@
public class GitRepo : Object
}
}
- 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" };
{
string[] cmd = { "pull" , "--no-edit" };
- return this.git_async( cmd , cb);
+ this.git_async( cmd , cb);
+
}
}
@@
-352,11
+353,11
@@
public class GitRepo : Object
return sp.output;
}
return sp.output;
}
-
+ unowned GitAsyncCallback git_async_on_callback;
public void git_async( string[] args_in, GitAsyncCallback cb ) throws Error, SpawnError
{
// convert arguments.
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;
string[] args = { "git" };
//args += "--git-dir";
//args += this.gitdir;
@@
-392,9
+393,20
@@
public class GitRepo : Object
// may throw error...
var sp = new Spawn(cfg);
// may throw error...
var sp = new Spawn(cfg);
- sp.run((err, output) => {
-
cb(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();
+
+
+ }
+
}
}