mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-23 05:46:09 +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, "_")
|
return refNamePatternInvalid.ReplaceAllString(name, "_")
|
||||||
}
|
}
|
||||||
|
|
||||||
// RefName represents a git reference name
|
// Reference represents a Git ref.
|
||||||
type RefName string
|
type Reference struct {
|
||||||
|
Name string
|
||||||
func (ref RefName) IsBranch() bool {
|
repo *Repository
|
||||||
return strings.HasPrefix(string(ref), BranchPrefix)
|
Object SHA1 // The id of this commit object
|
||||||
|
Type string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ref RefName) IsTag() bool {
|
// Commit return the commit of the reference
|
||||||
return strings.HasPrefix(string(ref), TagPrefix)
|
func (ref *Reference) Commit() (*Commit, error) {
|
||||||
|
return ref.repo.getCommit(ref.Object)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShortName returns the short name of the reference
|
// ShortName returns the short name of the reference
|
||||||
@ -108,26 +110,3 @@ func (ref RefName) RefGroup() string {
|
|||||||
}
|
}
|
||||||
return ""
|
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