Exclude all nested git repos

This commit is contained in:
Steve Streeting 2016-11-01 10:23:55 +00:00
parent c8700731b6
commit 546d6ad603

@ -226,7 +226,8 @@ func FastWalkWithExcludeFiles(dir, excludeFilename string,
// FastWalkGitRepo behaves like FastWalkWithExcludeFiles, preconfigured to ignore // FastWalkGitRepo behaves like FastWalkWithExcludeFiles, preconfigured to ignore
// the git repo itself (.git) and to load exclude patterns from .gitignore // the git repo itself (.git) and to load exclude patterns from .gitignore
func FastWalkGitRepo(dir string) (<-chan FastWalkInfo, <-chan error) { func FastWalkGitRepo(dir string) (<-chan FastWalkInfo, <-chan error) {
excludePaths := []string{".git"} // Ignore all git metadata including subrepos
excludePaths := []string{filepath.Join("*", ".git")}
return FastWalkWithExcludeFiles(dir, ".gitignore", nil, excludePaths) return FastWalkWithExcludeFiles(dir, ".gitignore", nil, excludePaths)
} }