Path returns the full path to this repository on disk. This is relative to the gitdir root.
()
| 52 | // Path returns the full path to this repository on disk. This is relative to |
| 53 | // the gitdir root. |
| 54 | func (repo RepoLookup) Path() string { |
| 55 | switch repo.Type { |
| 56 | case RepoTypeAdmin: |
| 57 | return "admin/admin" |
| 58 | case RepoTypeOrgConfig: |
| 59 | return path.Join("admin", "org-"+repo.PathParts[0]) |
| 60 | case RepoTypeOrg: |
| 61 | return path.Join("orgs", repo.PathParts[0], repo.PathParts[1]) |
| 62 | case RepoTypeUserConfig: |
| 63 | return path.Join("admin", "user-"+repo.PathParts[0]) |
| 64 | case RepoTypeUser: |
| 65 | return path.Join("users", repo.PathParts[0], repo.PathParts[1]) |
| 66 | case RepoTypeTopLevel: |
| 67 | return path.Join("top-level", repo.PathParts[0]) |
| 68 | } |
| 69 | |
| 70 | return "/dev/null" |
| 71 | } |
| 72 | |
| 73 | // ErrInvalidRepoFormat is returned when a repo is looked up which cannot |
| 74 | // exist based on the parsed format. |
no outgoing calls