Merge pull request #842 from AudriusButkevicius/ignorecache

Cache ignore file matches
This commit is contained in:
Jakob Borg
2014-10-14 12:43:21 +02:00
9 changed files with 302 additions and 36 deletions

View File

@@ -36,7 +36,7 @@ type Walker struct {
// BlockSize controls the size of the block used when hashing.
BlockSize int
// List of patterns to ignore
Ignores ignore.Patterns
Ignores *ignore.Matcher
// If TempNamer is not nil, it is used to ignore tempory files when walking.
TempNamer TempNamer
// If CurrentFiler is not nil, it is queried for the current file before rescanning.

View File

@@ -58,7 +58,7 @@ func init() {
}
func TestWalkSub(t *testing.T) {
ignores, err := ignore.Load("testdata/.stignore")
ignores, err := ignore.Load("testdata/.stignore", false)
if err != nil {
t.Fatal(err)
}
@@ -93,7 +93,7 @@ func TestWalkSub(t *testing.T) {
}
func TestWalk(t *testing.T) {
ignores, err := ignore.Load("testdata/.stignore")
ignores, err := ignore.Load("testdata/.stignore", false)
if err != nil {
t.Fatal(err)
}