mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-22 21:35:21 +02:00
chore: resolve conflict
This commit is contained in:
parent
9bd773eb85
commit
f869c988a5
@ -40,15 +40,17 @@ func SanitizeRefPattern(name string) string {
|
||||
return refNamePatternInvalid.ReplaceAllString(name, "_")
|
||||
}
|
||||
|
||||
// RefName represents a git reference name
|
||||
type RefName string
|
||||
|
||||
func (ref RefName) IsBranch() bool {
|
||||
return strings.HasPrefix(string(ref), BranchPrefix)
|
||||
// Reference represents a Git ref.
|
||||
type Reference struct {
|
||||
Name string
|
||||
repo *Repository
|
||||
Object SHA1 // The id of this commit object
|
||||
Type string
|
||||
}
|
||||
|
||||
func (ref RefName) IsTag() bool {
|
||||
return strings.HasPrefix(string(ref), TagPrefix)
|
||||
// Commit return the commit of the reference
|
||||
func (ref *Reference) Commit() (*Commit, error) {
|
||||
return ref.repo.getCommit(ref.Object)
|
||||
}
|
||||
|
||||
// ShortName returns the short name of the reference
|
||||
@ -108,26 +110,3 @@ func (ref RefName) RefGroup() string {
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// Reference represents a Git ref.
|
||||
type Reference struct {
|
||||
Name string
|
||||
repo *Repository
|
||||
Object SHA1 // The id of this commit object
|
||||
Type string
|
||||
}
|
||||
|
||||
// Commit return the commit of the reference
|
||||
func (ref *Reference) Commit() (*Commit, error) {
|
||||
return ref.repo.getCommit(ref.Object)
|
||||
}
|
||||
|
||||
// ShortName returns the short name of the reference name
|
||||
func (ref *Reference) ShortName() string {
|
||||
return RefName(ref.Name).ShortName()
|
||||
}
|
||||
|
||||
// RefGroup returns the group type of the reference
|
||||
func (ref *Reference) RefGroup() string {
|
||||
return RefName(ref.Name).RefGroup()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user