diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-09-22 12:39:00 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-09-22 12:39:00 -0600 |
commit | 6cfa6622f31953bd75bfae4c9b10915e3dd6bd78 (patch) | |
tree | 71c6d9b9e76ba0abc9ae6031a316f644246461d7 /refs.go | |
parent | 1a1832b77d53849a0aa8216627301aaf9e18d6f8 (diff) |
Go documentation for all public functions
Diffstat (limited to 'refs.go')
-rw-r--r-- | refs.go | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2,6 +2,7 @@ package syw import "strings" +// Ref is an object representing a commit in a repository. type Ref struct { Repo *Repository Name string @@ -11,6 +12,7 @@ type Ref struct { func (r Ref) IsBranch() bool { return strings.HasPrefix(r.Name, "refs/heads/") } func (r Ref) IsTag() bool { return strings.HasPrefix(r.Name, "refs/tags/") } +// ShortName returns the branch or tag name with "refs/[heads|tags]/" trimmed off. func (r Ref) ShortName() string { if r.IsBranch() { return r.Name[11:] |