From 3d2cb176346b5ccf4d6d25898d48cee0a7090f6a Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 12 Feb 2011 23:40:38 +0000 Subject: [PATCH] [repo] Fix pushing bug --- SparkleLib/SparkleListener.cs | 7 ++++--- SparkleLib/SparkleRepo.cs | 21 ++++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/SparkleLib/SparkleListener.cs b/SparkleLib/SparkleListener.cs index f37745d2..d6741b57 100644 --- a/SparkleLib/SparkleListener.cs +++ b/SparkleLib/SparkleListener.cs @@ -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, diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index d9b36aaa..833f89bc 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -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 (); }