From 23fc46bc09a6f3e482a111444fbdda039ed5dbc1 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 26 Feb 2012 15:58:09 +0000 Subject: [PATCH] fetcher git: don't simulate progress when clone command failed --- SparkleLib/Git/SparkleFetcherGit.cs | 35 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 0b7f7e4f..00af578e 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -135,29 +135,30 @@ namespace SparkleLib { } this.git.WaitForExit (); - SparkleHelpers.DebugInfo ("Git", "Exit code " + this.git.ExitCode.ToString ()); + SparkleHelpers.DebugInfo ("Git", "Exit code: " + this.git.ExitCode); - while (percentage < 100) { - percentage += 25; + if (this.git.ExitCode == 0) { + while (percentage < 100) { + percentage += 25; + + if (percentage >= 100) + break; + + base.OnProgressChanged (percentage); + Thread.Sleep (750); + } + + base.OnProgressChanged (100); + Thread.Sleep (1000); - if (percentage >= 100) - break; - - base.OnProgressChanged (percentage); - Thread.Sleep (750); - } - - base.OnProgressChanged (100); - Thread.Sleep (1000); - - if (this.git.ExitCode != 0) { - return false; - - } else { InstallConfiguration (); InstallExcludeRules (); AddWarnings (); + return true; + + } else { + return false; } }