From faae819f5d8a662ec2df88205ab6d9b1871f1dd1 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 30 May 2023 21:36:58 +0800 Subject: revert the removed method to fix tmpl break on graph page (#25005) Fix #24996 Caused by #24634 --- modules/git/ref.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules') 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() -- cgit v1.2.3