diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index d8b73137..9747549f 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -128,12 +128,11 @@ namespace SparkleLib { public override bool SyncUp () { Add (); - - string message = FormatCommitMessage (); - Commit (message); + Commit ("Changes made by SparkleShare"); SparkleGit git = new SparkleGit (LocalPath, "push origin master"); git.Start (); + git.StandardOutput.ReadToEnd (); git.WaitForExit (); if (git.ExitCode == 0) @@ -228,11 +227,9 @@ namespace SparkleLib { // Commits the made changes private void Commit (string message) { - if (!AnyDifferences) - return; - SparkleGit git = new SparkleGit (LocalPath, "commit -m \"" + message + "\""); git.Start (); + git.StandardOutput.ReadToEnd (); git.WaitForExit (); SparkleHelpers.DebugInfo ("Commit", "[" + Name + "] " + message); @@ -268,7 +265,6 @@ namespace SparkleLib { ResolveConflict (); SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Conflict resolved."); - OnConflictResolved (); } diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index e313faa2..d877994e 100644 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -276,6 +276,7 @@ namespace SparkleLib { { lock (this.change_lock) { if (this.has_changed) { + Console.WriteLine ("checking..."); if (this.sizebuffer.Count >= 4) this.sizebuffer.RemoveAt (0); @@ -317,6 +318,10 @@ namespace SparkleLib { if (AnyDifferences) { this.is_buffering = true; + // We want to disable wathcing temporarily, but + // not stop the local timer + this.watcher.EnableRaisingEvents = false; + // Only fire the event if the timer has been stopped. // This prevents multiple events from being raised whilst "buffering". if (!this.has_changed) { @@ -326,7 +331,7 @@ namespace SparkleLib { SparkleHelpers.DebugInfo ("Event", "[" + Name + "] " + wct.ToString () + " '" + args.Name + "'"); SparkleHelpers.DebugInfo ("Event", "[" + Name + "] Changes found, checking if settled."); - + this.remote_timer.Stop (); lock (this.change_lock) {