@@ -38,6 +38,9 @@ type ConfigEntry struct {
3838 GitilesURL string
3939 CGitURL string
4040 BitBucketServerURL string
41+ GiteaURL string
42+ GiteaUser string
43+ GiteaOrg string
4144 DisableTLS bool
4245 CredentialPath string
4346 ProjectType string
@@ -54,6 +57,7 @@ type ConfigEntry struct {
5457 GerritFetchMetaConfig bool
5558 GerritRepoNameFormat string
5659 ExcludeUserRepos bool
60+ Forks bool
5761}
5862
5963func randomize (entries []ConfigEntry ) []ConfigEntry {
@@ -200,6 +204,9 @@ func executeMirror(cfg []ConfigEntry, repoDir string, pendingRepos chan<- string
200204 if ! c .KeepDeleted {
201205 cmd .Args = append (cmd .Args , "-delete" )
202206 }
207+ if c .Forks {
208+ cmd .Args = append (cmd .Args , "-forks" )
209+ }
203210 } else if c .GitilesURL != "" {
204211 cmd = exec .Command ("zoekt-mirror-gitiles" ,
205212 "-dest" , repoDir , "-name" , c .Name )
@@ -288,6 +295,40 @@ func executeMirror(cfg []ConfigEntry, repoDir string, pendingRepos chan<- string
288295 cmd .Args = append (cmd .Args , "-delete" )
289296 }
290297 cmd .Args = append (cmd .Args , c .GerritApiURL )
298+ } else if c .GiteaURL != "" {
299+ cmd = exec .Command ("zoekt-mirror-gitea" , "-dest" , repoDir )
300+ if c .GiteaURL != "" {
301+ cmd .Args = append (cmd .Args , "-url" , c .GiteaURL )
302+ }
303+ if c .GiteaUser != "" {
304+ cmd .Args = append (cmd .Args , "-user" , c .GiteaUser )
305+ } else if c .GiteaOrg != "" {
306+ cmd .Args = append (cmd .Args , "-org" , c .GiteaOrg )
307+ }
308+ if c .Name != "" {
309+ cmd .Args = append (cmd .Args , "-name" , c .Name )
310+ }
311+ if c .Exclude != "" {
312+ cmd .Args = append (cmd .Args , "-exclude" , c .Exclude )
313+ }
314+ if c .CredentialPath != "" {
315+ cmd .Args = append (cmd .Args , "-token" , c .CredentialPath )
316+ }
317+ for _ , topic := range c .Topics {
318+ cmd .Args = append (cmd .Args , "-topic" , topic )
319+ }
320+ for _ , topic := range c .ExcludeTopics {
321+ cmd .Args = append (cmd .Args , "-exclude_topic" , topic )
322+ }
323+ if c .NoArchived {
324+ cmd .Args = append (cmd .Args , "-no_archived" )
325+ }
326+ if ! c .KeepDeleted {
327+ cmd .Args = append (cmd .Args , "-delete" )
328+ }
329+ if c .Forks {
330+ cmd .Args = append (cmd .Args , "-forks" )
331+ }
291332 } else {
292333 log .Printf ("executeMirror: ignoring config, because it does not contain any valid repository definition: %v" , c )
293334 continue
0 commit comments