(path string)
| 3023 | } |
| 3024 | |
| 3025 | func splitOwnerRepo(path string) (string, string, error) { |
| 3026 | trimmed := strings.Trim(path, "/") |
| 3027 | if trimmed == "" { |
| 3028 | return "", "", fmt.Errorf("invalid GitHub repository path: %q", path) |
| 3029 | } |
| 3030 | parts := strings.Split(trimmed, "/") |
| 3031 | if len(parts) < 2 { |
| 3032 | return "", "", fmt.Errorf("invalid GitHub repository path: %q", path) |
| 3033 | } |
| 3034 | if len(parts) > 2 { |
| 3035 | return "", "", fmt.Errorf("unexpected extra path components in %q", path) |
| 3036 | } |
| 3037 | owner := parts[0] |
| 3038 | repo := strings.TrimSuffix(parts[1], ".git") |
| 3039 | if owner == "" || repo == "" { |
| 3040 | return "", "", fmt.Errorf("invalid GitHub repository path: %q", path) |
| 3041 | } |
| 3042 | return owner, repo, nil |
| 3043 | } |
| 3044 | |
| 3045 | func runPrivateForkRepo(ctx *snap.Context) error { |
| 3046 | return privateForkRepoFlow(ctx, "privateForkRepo", false) |
no outgoing calls
no test coverage detected