giturl

package
v0.0.0-...-7086fdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBranchFromURL

func ParseBranchFromURL(gitURL string) string

ParseBranchFromURL 从 Git 仓库地址中解析分支名,如果未指定则默认返回 main 处理 GitHub 的 tree URL,例如: https://github.com/owner/repo/tree/feat-schema

func RepoFullName

func RepoFullName(raw string) (string, error)

RepoFullName 返回 owner/repo 格式的仓库全名

func ResolveBranch

func ResolveBranch(configuredBranch, repoURL string) string

ResolveBranch 解析分支名,优先使用配置中的 branch,如果为空则从 URL 解析或使用默认 main

Types

type GitURL

type GitURL struct {
	Host  string
	Owner string
	Repo  string
}

GitURL 表示从 URL 解析出来的 Git 仓库信息

func Parse

func Parse(raw string) (*GitURL, error)

Parse 解析 git URL,提取 host/owner/repo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL