[repo] Fix pushing bug

This commit is contained in:
Hylke Bons 2011-02-12 23:40:38 +00:00
parent 6529cf0320
commit 3d2cb17634
2 changed files with 20 additions and 8 deletions

View file

@ -52,9 +52,10 @@ namespace SparkleLib {
if (Nick.Length > 9)
Nick = Nick.Substring (0, 9);
// TODO: Remove these hardcoded values
Channel = "#sparkletest";
Server = "irc.gnome.org";
// Channel = "#sparkletest";
// Server = "irc.gnome.org";
Channel = channel;
Server = server;
Client = new IrcClient () {
PingTimeout = 120,

View file

@ -832,6 +832,15 @@ namespace SparkleLib {
_IsPushing = true;
SparkleEventArgs args = new SparkleEventArgs ("PushingStarted");
Process process = new Process () {
EnableRaisingEvents = true
};
process.StartInfo.FileName = SparklePaths.GitPath;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.WorkingDirectory = LocalPath;
if (PushingStarted != null)
PushingStarted (this, args);
@ -855,16 +864,16 @@ namespace SparkleLib {
}
*/
Process.StartInfo.Arguments = "push origin master";
process.StartInfo.Arguments = "push origin master";
Process.WaitForExit ();
Process.Exited += delegate {
process.Exited += delegate {
_IsSyncing = false;
_IsPushing = false;
if (Process.ExitCode != 0) {
if (process.ExitCode != 0) {
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Pushing failed.");
@ -901,7 +910,9 @@ namespace SparkleLib {
}
};
Process.Start ();
process.Start ();
process.WaitForExit ();
}