fileConfigToAppConfig converts a fileConfig into an appConfig. Migration-related fields are left at their zero values since they are CLI-only flags.
(fc *fileConfig)
| 125 | // Migration-related fields are left at their zero values since they |
| 126 | // are CLI-only flags. |
| 127 | func fileConfigToAppConfig(fc *fileConfig) *appConfig { |
| 128 | return &appConfig{ |
| 129 | service: fc.Service, |
| 130 | gitHostURL: fc.GitHostURL, |
| 131 | backupDir: fc.BackupDir, |
| 132 | ignorePrivate: fc.IgnorePrivate, |
| 133 | ignoreFork: fc.IgnoreFork, |
| 134 | useHTTPSClone: fc.UseHTTPSClone, |
| 135 | bare: fc.Bare, |
| 136 | githubRepoType: fc.GitHub.RepoType, |
| 137 | githubNamespaceWhitelist: fc.GitHub.NamespaceWhitelist, |
| 138 | gitlabProjectVisibility: fc.GitLab.ProjectVisibility, |
| 139 | gitlabProjectMembershipType: fc.GitLab.ProjectMembershipType, |
| 140 | forgejoRepoType: fc.Forgejo.RepoType, |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | // loadConfigFile reads and parses the config file at the given path, |
| 145 | // or at the OS-specific default location if configPath is empty. |