diff --git a/cmd/zoekt-indexserver/config.go b/cmd/zoekt-indexserver/config.go index e35fda6a..b9f2661e 100644 --- a/cmd/zoekt-indexserver/config.go +++ b/cmd/zoekt-indexserver/config.go @@ -250,6 +250,9 @@ func executeMirror(cfg []ConfigEntry, repoDir string, pendingRepos chan<- string if c.CredentialPath != "" { cmd.Args = append(cmd.Args, "-token", c.CredentialPath) } + if c.NoArchived { + cmd.Args = append(cmd.Args, "-no_archived") + } } else if c.GerritApiURL != "" { cmd = exec.Command("zoekt-mirror-gerrit", "-dest", repoDir, "-delete") diff --git a/cmd/zoekt-mirror-gitlab/main.go b/cmd/zoekt-mirror-gitlab/main.go index b37c18ca..55d3fee0 100644 --- a/cmd/zoekt-mirror-gitlab/main.go +++ b/cmd/zoekt-mirror-gitlab/main.go @@ -51,6 +51,8 @@ func main() { namePattern := flag.String("name", "", "only clone repos whose name matches the given regexp.") excludePattern := flag.String("exclude", "", "don't mirror repos whose names match this regexp.") lastActivityAfter := flag.String("last_activity_after", "", "only mirror repos that have been active since this date (format: 2006-01-02).") + noArchived := flag.Bool("no_archived", false, "mirror only projects that are not archived") + flag.Parse() if *dest == "" { @@ -100,6 +102,10 @@ func main() { opt.LastActivityAfter = gitlab.Time(targetDate) } + if *noArchived { + opt.Archived = gitlab.Bool(false) + } + var gitlabProjects []*gitlab.Project for { projects, _, err := client.Projects.ListProjects(opt)