diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index f4752b73..5d30cde7 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -828,14 +828,14 @@ namespace SparkleLib.Git { // Recursively gets a folder's size in bytes private double CalculateSizes (DirectoryInfo parent) { - if (!Directory.Exists (parent.ToString ())) + if (!Directory.Exists (parent.FullName)) return 0; - double size = 0; - if (parent.Name.Equals ("rebase-apply")) return 0; + double size = 0; + try { foreach (FileInfo file in parent.GetFiles ()) { if (!file.Exists) @@ -847,11 +847,18 @@ namespace SparkleLib.Git { size += file.Length; } - // FIXME: Doesn't seem to recurse on Windows + } catch (Exception e) { + SparkleHelpers.DebugInfo ("Local", "Error calculating size: " + e.Message); + return 0; + } + + + try { foreach (DirectoryInfo directory in parent.GetDirectories ()) size += CalculateSizes (directory); - } catch (Exception) { + } catch (Exception e) { + SparkleHelpers.DebugInfo ("Local", "Error calculating size: " + e.Message); return 0; }