diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index f0ae14d0..ef90cd3a 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -137,7 +137,6 @@ namespace SparkleLib { Commit (message); SparkleGit git = new SparkleGit (LocalPath, "push origin master"); - git.Start (); git.WaitForExit (); @@ -168,9 +167,12 @@ namespace SparkleLib { get { SparkleGit git = new SparkleGit (LocalPath, "status --porcelain"); git.Start (); + + // Reading the standard output HAS to go before + // WaitForExit, or it will hang forever on output > 4096 bytes + string output = git.StandardOutput.ReadToEnd ().TrimEnd (); git.WaitForExit (); - string output = git.StandardOutput.ReadToEnd ().TrimEnd (); string [] lines = output.Split ("\n".ToCharArray ()); foreach (string line in lines) { @@ -300,9 +302,12 @@ namespace SparkleLib { SparkleGit git_status = new SparkleGit (LocalPath, "status --porcelain"); git_status.Start (); - git_status.WaitForExit (); - string output = git_status.StandardOutput.ReadToEnd ().TrimEnd (); + // Reading the standard output HAS to go before + // WaitForExit, or it will hang forever on output > 4096 bytes + string output = git_status.StandardOutput.ReadToEnd ().TrimEnd (); + git.WaitForExit (); + string [] lines = output.Split ("\n".ToCharArray ()); foreach (string line in lines) {