mirror of
https://github.com/go-task/task.git
synced 2026-07-09 06:55:14 +00:00
go-git pulled ~30 transitive dependencies and recursively walked the entire worktree on every Globs() call. Replace with sabhiram/go-gitignore (zero dependencies) and a simple walk from task dir up to rootDir to collect .gitignore files. Pass rootDir (Taskfile ROOT_DIR) through the checker chain to bound the search scope.
17 lines
422 B
Go
17 lines
422 B
Go
package fingerprint
|
|
|
|
import "fmt"
|
|
|
|
func NewSourcesChecker(method, tempDir string, dry bool, rootDir string) (SourcesCheckable, error) {
|
|
switch method {
|
|
case "timestamp":
|
|
return NewTimestampChecker(tempDir, dry, rootDir), nil
|
|
case "checksum":
|
|
return NewChecksumChecker(tempDir, dry, rootDir), nil
|
|
case "none":
|
|
return NoneChecker{}, nil
|
|
default:
|
|
return nil, fmt.Errorf(`task: invalid method "%s"`, method)
|
|
}
|
|
}
|