Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeCloneURL ¶
NormalizeCloneURL 把仓库 URL 调整成可被 git clone 使用的形式。
当前只针对阿里云 Codeup:Codeup 仓库 URL 不带 .git 后缀时 git clone 会失败, 这里在 hostname 命中时自动补 .git。其它平台(GitHub/Gitee/GitLab/Gitea 等) 同时接受带或不带 .git 的 URL,原样返回。
同时兼容 HTTPS(https://codeup.aliyun.com/...)和 SSH(git@codeup.aliyun.com:...)两种形式。
func ParseBranchFromURL ¶
ParseBranchFromURL 从 Git 仓库地址中解析分支名,如果未指定则默认返回 main 处理 GitHub 的 tree URL,例如: https://github.com/owner/repo/tree/feat-schema
func RepoFullName ¶
RepoFullName 返回 owner/repo 格式的仓库全名
func ResolveBranch ¶
ResolveBranch 解析分支名,优先使用配置中的 branch,如果为空则从 URL 解析或使用默认 main
Types ¶
Click to show internal directories.
Click to hide internal directories.