diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index e1c8c167..d25bdb19 100755 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -59,6 +59,16 @@ namespace SparkleLib { } + public override List ExcludePaths { + get { + List rules = new List (); + rules.Add (Path.DirectorySeparatorChar + ".git"); + + return rules; + } + } + + public override double Size { get { return CalculateSize ( diff --git a/SparkleLib/SparkleRepoBase.cs b/SparkleLib/SparkleRepoBase.cs index 5b1a9025..867e602b 100755 --- a/SparkleLib/SparkleRepoBase.cs +++ b/SparkleLib/SparkleRepoBase.cs @@ -66,6 +66,7 @@ namespace SparkleLib { public abstract bool SyncDown (); public abstract double CalculateSize (DirectoryInfo parent); public abstract bool HasUnsyncedChanges { get; set; } + public abstract List ExcludePaths { get; } public abstract double Size { get; } public abstract double HistorySize { get; } @@ -342,9 +343,12 @@ namespace SparkleLib { if (!this.watcher.EnableRaisingEvents) return; - if (args.FullPath.Contains (Path.DirectorySeparatorChar + ".") && - !args.FullPath.Contains (Path.DirectorySeparatorChar + ".notes")) - return; + string relative_path = args.FullPath.Replace (LocalPath, ""); + + foreach (string exclude_path in ExcludePaths) { + if (relative_path.Contains (exclude_path)) + return; + } WatcherChangeTypes wct = args.ChangeType; diff --git a/SparkleLib/SparkleWatcher.cs b/SparkleLib/SparkleWatcher.cs index ae0ec573..f1c477fd 100755 --- a/SparkleLib/SparkleWatcher.cs +++ b/SparkleLib/SparkleWatcher.cs @@ -51,7 +51,6 @@ namespace SparkleLib { if (ChangeEvent != null) ChangeEvent (args); }; - } } }