From 9048474c02398c6801a5bc174c63bb41ac532e93 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Wed, 19 May 2010 00:39:56 +0100 Subject: [PATCH] check for changes before merging, but reading output doesn't work --- SparkleShare/SparkleRepo.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SparkleShare/SparkleRepo.cs b/SparkleShare/SparkleRepo.cs index 180a273c..f6decff2 100644 --- a/SparkleShare/SparkleRepo.cs +++ b/SparkleShare/SparkleRepo.cs @@ -223,11 +223,13 @@ namespace SparkleShare { FetchTimer.Stop (); // SparkleUI.NotificationIcon.SetSyncingState (); Console.WriteLine ("[Git][" + Name + "] Fetching changes... "); - Process.StartInfo.Arguments = "fetch -v"; // TODO: Only call merge when there are changes + Process.StartInfo.Arguments = "fetch -v"; Process.Start(); + string Output = Process.StandardOutput.ReadToEnd().Trim (); // TODO: This doesn't work :( Process.WaitForExit (); Console.WriteLine ("[Git][" + Name + "] Changes fetched."); - Merge (); + if (!Output.Contains ("up to date")) + Merge (); // SparkleUI.NotificationIcon.SetIdleState (); FetchTimer.Start (); }