diff --git a/SparkleLib/SparkleRepo.cs b/SparkleLib/SparkleRepo.cs index cde9ca99..0b93f3d9 100644 --- a/SparkleLib/SparkleRepo.cs +++ b/SparkleLib/SparkleRepo.cs @@ -486,7 +486,7 @@ namespace SparkleLib { _IsBuffering = false; HasChanged = false; - while (Status.AnyDifferences) { + while (AnyDifferences) { Watcher.EnableRaisingEvents = false; AddCommitAndPush (); @@ -554,7 +554,7 @@ namespace SparkleLib { LocalTimer.Stop (); RemoteTimer.Stop (); - if (Status.AnyDifferences) { + if (AnyDifferences) { Add (); @@ -580,6 +580,26 @@ namespace SparkleLib { } } + + + public bool AnyDifferences { + + get { + + SparkleGit git = new SparkleGit (LocalPath, "status --porcelain"); + git.Start (); + git.WaitForExit (); + + string output = git.StandardOutput.ReadToEnd ().Trim (); + + if (output.Length > 0) + return true; + else + return false; + + } + + } // Stages the made changes @@ -624,7 +644,7 @@ namespace SparkleLib { new public void Commit (string message) { - if (!Status.AnyDifferences) + if (!AnyDifferences) return; base.Commit (message); @@ -710,7 +730,7 @@ namespace SparkleLib { public void Rebase () { - if (Status.AnyDifferences) { + if (AnyDifferences) { Add (); diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 67c9b282..af1e6cea 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -241,6 +241,9 @@ namespace SparkleShare { List commits = GetLog (name); List activity_days = new List (); + + if (commits.Count == 0) + return null; foreach (SparkleCommit commit in commits) {