repo git: don't hang on huge command outputs
This commit is contained in:
parent
c498347931
commit
0944efe992
|
@ -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 ();
|
||||
|
||||
// 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) {
|
||||
|
|
Loading…
Reference in a new issue