MCPcopy Create free account
hub / github.com/ChappIO/git-backup / ListRepositories

Method ListRepositories

github.go:42–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42func (c *GithubConfig) ListRepositories() ([]*Repository, error) {
43 repos, err := c.getAllRepos()
44 if err != nil {
45 return nil, err
46 }
47 out := make([]*Repository, 0, len(repos))
48 for _, repo := range repos {
49 if isExcluded(c.Exclude, *repo.FullName) {
50 log.Printf("Skipping excluded repository: %s", *repo.FullName)
51 continue
52 }
53
54 gitUrl, err := url.Parse(*repo.CloneURL)
55 if err != nil {
56 return out, err
57 }
58 gitUrl.User = url.UserPassword("github", c.AccessToken)
59
60 out = append(out, &Repository{
61 FullName: *repo.FullName,
62 GitURL: *gitUrl,
63 })
64
65 }
66 return out, nil
67}
68
69func (c *GithubConfig) setDefaults() {
70 if c.JobName == "" {

Callers

nothing calls this directly

Calls 2

getAllReposMethod · 0.95
isExcludedFunction · 0.85

Tested by

no test coverage detected