From 0720d3988f3e088e527dd857756d6598694494a7 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 12 Mar 2015 16:01:23 -0400 Subject: #988: GetRepoLink already contains AppSubUrl --- models/action.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'models') diff --git a/models/action.go b/models/action.go index f872104e..f97ecfcd 100644 --- a/models/action.go +++ b/models/action.go @@ -97,8 +97,15 @@ func (a Action) GetRepoName() string { return a.RepoName } +func (a Action) GetRepoPath() string { + return path.Join(a.RepoUserName, a.RepoName) +} + func (a Action) GetRepoLink() string { - return path.Join(setting.AppSubUrl, a.RepoUserName, a.RepoName) + if len(setting.AppSubUrl) > 0 { + return path.Join(setting.AppSubUrl, a.GetRepoPath()) + } + return "/" + a.GetRepoPath() } func (a Action) GetBranch() string { -- cgit v1.2.3