summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-05-30 21:36:58 +0800
committerGitHub <noreply@github.com>2023-05-30 21:36:58 +0800
commitfaae819f5d8a662ec2df88205ab6d9b1871f1dd1 (patch)
treeaff4bb3855f31aeb90391e0720b8cbfcc6d7b6dd /modules
parentee99cf6313ba565523b3c43f61ffda4b71e2c39b (diff)
downloadgitea-faae819f5d8a662ec2df88205ab6d9b1871f1dd1.tar.gz
gitea-faae819f5d8a662ec2df88205ab6d9b1871f1dd1.zip
revert the removed method to fix tmpl break on graph page (#25005)
Fix #24996 Caused by #24634
Diffstat (limited to 'modules')
-rw-r--r--modules/git/ref.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/git/ref.go b/modules/git/ref.go
index d3d1320e50..73095f8dbe 100644
--- a/modules/git/ref.go
+++ b/modules/git/ref.go
@@ -53,6 +53,11 @@ func (ref *Reference) Commit() (*Commit, error) {
return ref.repo.getCommit(ref.Object)
}
+// ShortName returns the short name of the reference
+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()