@@ -18,7 +18,7 @@ import (
1818func FindRepos (
1919 roots []string ,
2020 dirignore []string ,
21- ) (repoPaths []vcs.RepoPath , warnings []string ) {
21+ ) (repos []vcs.RepoInfo , warnings []string ) {
2222 matcher := NewIgnoreMatcher (roots , dirignore )
2323
2424 visitedDir := map [string ]struct {}{}
@@ -47,7 +47,7 @@ func FindRepos(
4747 visitedDir [path ] = struct {}{}
4848
4949 if repoType , ok := detectRepoType (path ); ok {
50- repoPaths = append (repoPaths , vcs.RepoPath {
50+ repos = append (repos , vcs.RepoInfo {
5151 Path : path ,
5252 Type : repoType ,
5353 })
@@ -57,7 +57,7 @@ func FindRepos(
5757 })
5858 }
5959
60- return removeDuplicateRepoPaths ( repoPaths ), warnings
60+ return removeDuplicateRepoInfo ( repos ), warnings
6161}
6262
6363func detectRepoType (path string ) (vcs.Type , bool ) {
@@ -100,14 +100,14 @@ func isJJRepo(path string) bool {
100100 return info .IsDir ()
101101}
102102
103- func removeDuplicateRepoPaths ( repoPaths []vcs.RepoPath ) []vcs.RepoPath {
104- seen := make (map [string ]struct {}, len (repoPaths ))
105- distinct := make ([]vcs.RepoPath , 0 , len (repoPaths ))
103+ func removeDuplicateRepoInfo ( repos []vcs.RepoInfo ) []vcs.RepoInfo {
104+ seen := make (map [string ]struct {}, len (repos ))
105+ distinct := make ([]vcs.RepoInfo , 0 , len (repos ))
106106
107- for _ , repoPath := range repoPaths {
108- if _ , ok := seen [repoPath .Path ]; ! ok {
109- seen [repoPath .Path ] = struct {}{}
110- distinct = append (distinct , repoPath )
107+ for _ , repo := range repos {
108+ if _ , ok := seen [repo .Path ]; ! ok {
109+ seen [repo .Path ] = struct {}{}
110+ distinct = append (distinct , repo )
111111 }
112112 }
113113
0 commit comments