diff options
| author | 2026-03-26 09:19:01 +0000 | |
|---|---|---|
| committer | 2026-03-26 09:19:01 +0000 | |
| commit | 929b8cc620abca70b3444b09be5249f6c6cb7812 (patch) | |
| tree | 29b1edba8f597d09a2a51a6b2c901389cc40e242 /ref/refname/branch.go | |
| parent | format: Move commitgraph and packfile here (diff) | |
| signature | No signature | |
ref/name: Rename from ref/refname
Diffstat (limited to 'ref/refname/branch.go')
| -rw-r--r-- | ref/refname/branch.go | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/ref/refname/branch.go b/ref/refname/branch.go deleted file mode 100644 index 274a95e3..00000000 --- a/ref/refname/branch.go +++ /dev/null @@ -1,25 +0,0 @@ -package refname - -import "strings" - -// Branch checks one branch shorthand and returns its fully-qualified -// refs/heads/... name. -// -// Unlike Git in-repository branch parsing, this helper does not expand @{-n}. -func Branch(name string) (string, error) { - full := "refs/heads/" + name - if strings.HasPrefix(name, "-") || full == "refs/heads/HEAD" { - return "", &NameError{Name: name, Reason: "invalid branch name"} - } - - err := validate(full, 0) - if err != nil { - return "", err - } - - if strings.HasPrefix(name, "refs/") { - return name, nil - } - - return full, nil -} |
