summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/models/action.go b/models/action.go
index f872104eb2..f97ecfcde3 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 {