Merge pull request #1122 from brandondahler/HistoryFix

Do not include /.git file in calculating subdirectory size
This commit is contained in:
Hylke Bons 2013-01-02 06:09:24 -08:00
commit 8eed12ff30

View file

@ -1076,8 +1076,12 @@ namespace SparkleLib.Git {
try {
foreach (DirectoryInfo directory in parent.GetDirectories ())
size += CalculateSizes (directory);
foreach (DirectoryInfo directory in parent.GetDirectories ()) {
// Do not include LocalPath/.git file if it is a subdirectory
// This will not affect calling CalculateSizes on /.git directly
if (directory.FullName != Path.Combine (LocalPath, ".git"))
size += CalculateSizes (directory);
}
} catch (Exception e) {
SparkleLogger.LogInfo ("Local", "Error calculating size", e);