Permalink
Browse files

Added code to fix wrongful behaviour or Index.AddAll method.

  • Loading branch information...
1 parent 5748c3d commit 7ca5f6ca8fee8fb7819a4cfa8d7cb57c530927c3 unknown committed Jun 28, 2010
Showing with 15 additions and 2 deletions.
  1. +15 −2 GitSharp/Index.cs
View
@@ -136,12 +136,25 @@ private void AddFile(FileInfo path)
GitIndex.add(_repo._internal_repo.WorkingDirectory, path);
}
+ private GitSharp.Core.IgnoreHandler _ignoreHandler;
+ public GitSharp.Core.IgnoreHandler IgnoreHandler
+ {
+ get
+ {
+ if (_ignoreHandler == null)
+ _ignoreHandler = new Core.IgnoreHandler(_repo);
+ return _ignoreHandler;
+ }
+ }
+
private void AddDirectory(DirectoryInfo dir)
{
foreach (var file in dir.GetFiles())
- AddFile(file);
+ if (!IgnoreHandler.IsIgnored(file.FullName))
+ AddFile(file);
foreach (var subdir in dir.GetDirectories())
- AddDirectory(subdir);
+ if (subdir.Name != GitSharp.Core.Constants.DOT_GIT && !IgnoreHandler.IsIgnored(subdir.FullName))
+ AddDirectory(subdir);
}
/// <summary>

0 comments on commit 7ca5f6c

Please sign in to comment.