RepositoryPath returns the absolute path using given user and repository name.
(owner, repo string)
| 57 | // RepositoryPath returns the absolute path using given user and repository |
| 58 | // name. |
| 59 | func RepositoryPath(owner, repo string) string { |
| 60 | // 🚨 SECURITY: Prevent path traversal in repository name. |
| 61 | return filepath.Join(UserPath(owner), pathutil.Clean(strings.ToLower(repo))+".git") |
| 62 | } |
| 63 | |
| 64 | // RepositoryLocalPath returns the absolute path of the repository local copy |
| 65 | // with the given ID. |