From 0286060d9a3d610f5ee817032254399917abbec3 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 22 Sep 2012 22:43:40 +0100 Subject: [PATCH] repo: don't allow multiple syncs at the same time on startup. Fixes #985 --- SparkleLib/Git/SparkleRepoGit.cs | 3 ++- SparkleLib/SparkleRepoBase.cs | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index 9fea13a7..2658e36d 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -911,8 +911,9 @@ namespace SparkleLib.Git { } } - git_status.StandardOutput.ReadToEnd(); + git_status.StandardOutput.ReadToEnd (); git_status.WaitForExit (); + return message; } diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 83106f41..5e92b3a0 100755 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -193,10 +193,10 @@ namespace SparkleLib { // Sync up everything that changed // since we've been offline - if (HasLocalChanges) { + if (!this.is_syncing && (HasLocalChanges || HasUnsyncedChanges)) { SyncUpBase (); - while (HasUnsyncedChanges) + while (HasLocalChanges) SyncUpBase (); } @@ -408,7 +408,7 @@ namespace SparkleLib { this.poll_interval = PollInterval.Long; new Thread (() => { - if (!is_syncing && !HasLocalChanges && HasRemoteChanges) + if (!this.is_syncing && !HasLocalChanges && HasRemoteChanges) SyncDownBase (); }).Start (); @@ -430,7 +430,7 @@ namespace SparkleLib { this.poll_interval = PollInterval.Long; this.last_poll = DateTime.Now; - if (!is_syncing) { + if (!this.is_syncing) { // Check for changes manually one more time if (HasRemoteChanges) SyncDownBase ();