@@ -91,20 +91,22 @@ func getReposByOrg(config *config.GitXargsConfig) ([]*github.Repository, error)
91
91
}
92
92
93
93
// github.RepositoryListByOrgOptions doesn't seem to be able to filter out archived repos
94
- // So re-slice the repos list if --skip-archived-repos is passed and the repository is in archived/read-only state
95
- for i , repo := range repos {
96
- if config . SkipArchivedRepos && repo . GetArchived () {
97
- logger . WithFields (logrus. Fields {
98
- "Name" : repo . GetFullName (),
99
- }). Debug ( "Skipping archived repository" )
100
-
101
- // Track repos to skip because of archived status for our final run report
102
- config . Stats . TrackSingle ( stats . ReposArchivedSkipped , repo )
103
-
104
- reposToAdd = append ( repos [: i ], repos [ i + 1 :] ... )
105
- } else {
106
- reposToAdd = repos
94
+ // So filter the repos list if --skip-archived-repos is passed and the repository is in archived/read-only state
95
+ if config . SkipArchivedRepos {
96
+ for _ , repo := range repos {
97
+ if repo . GetArchived () {
98
+ logger . WithFields (logrus. Fields {
99
+ "Name" : repo . GetFullName (),
100
+ }). Debug ( "Skipping archived repository" )
101
+
102
+ // Track repos to skip because of archived status for our final run report
103
+ config . Stats . TrackSingle ( stats . ReposArchivedSkipped , repo )
104
+ } else {
105
+ reposToAdd = append ( reposToAdd , repo )
106
+ }
107
107
}
108
+ } else {
109
+ reposToAdd = repos
108
110
}
109
111
110
112
allRepos = append (allRepos , reposToAdd ... )
0 commit comments