diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index dc0378ac..b8498a9d 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -252,7 +252,7 @@ namespace SparkleLib { EnableWatching (); OnConflictResolved (); - SyncUp (); + RequestStatus (SyncStatus.SyncUp); } EnableWatching (); diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index db9e13f4..01b6da3e 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -347,6 +347,13 @@ namespace SparkleLib { } + protected void RequestStatus (SyncStatus requested_status) + { + if (requested_status == SyncStatus.SyncUp) + SyncUpBase (); + } + + private void SyncUpBase () { try { @@ -355,7 +362,6 @@ namespace SparkleLib { SparkleHelpers.DebugInfo ("SyncUp", "[" + Name + "] Initiated"); - //if (AnyDifferences) { if (SyncStatusChanged != null) SyncStatusChanged (SyncStatus.SyncUp); @@ -368,6 +374,7 @@ namespace SparkleLib { SyncStatusChanged (SyncStatus.Idle); this.listener.AnnounceBase (new SparkleAnnouncement (Identifier, CurrentRevision)); + } else { SparkleHelpers.DebugInfo ("SyncUp", "[" + Name + "] Error"); @@ -378,7 +385,7 @@ namespace SparkleLib { SyncDownBase (); } - //} + } finally { this.remote_timer.Start (); this.local_timer.Start ();