summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2017-11-27 02:58:54 +0200
committerGitHub <noreply@github.com>2017-11-27 02:58:54 +0200
commit0d4c63fd70d0b255a9a17352cc47ec2b6ca13440 (patch)
tree1128c5e474474bf7b2967dee8b9528dc207c6aa7 /routers
parentfb5c6b644460f94acb8976ad35165230b9d47fb2 (diff)
downloadgitea-0d4c63fd70d0b255a9a17352cc47ec2b6ca13440.tar.gz
gitea-0d4c63fd70d0b255a9a17352cc47ec2b6ca13440.zip
Fix go-get, src and raw urls to new scheme (#2978)
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/commit.go12
-rw-r--r--routers/repo/pull.go12
-rw-r--r--routers/repo/search.go2
3 files changed, 13 insertions, 13 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index 758771e657..2fcb65557d 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -237,11 +237,11 @@ func Diff(ctx *context.Context) {
ctx.Data["Diff"] = diff
ctx.Data["Parents"] = parents
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
- ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", commitID)
+ ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", "commit", commitID)
if commit.ParentCount() > 0 {
- ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", parents[0])
+ ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", "commit", parents[0])
}
- ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", commitID)
+ ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", "commit", commitID)
ctx.HTML(200, tplDiff)
}
@@ -302,9 +302,9 @@ func CompareDiff(ctx *context.Context) {
ctx.Data["Commit"] = commit
ctx.Data["Diff"] = diff
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
- ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", afterCommitID)
- ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", beforeCommitID)
- ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", afterCommitID)
+ ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", "commit", afterCommitID)
+ ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "src", "commit", beforeCommitID)
+ ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(userName, repoName, "raw", "commit", afterCommitID)
ctx.Data["RequireHighlightJS"] = true
ctx.HTML(200, tplDiff)
}
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index 14b0928734..284cb2d2d5 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -480,9 +480,9 @@ func ViewPullFiles(ctx *context.Context) {
}
ctx.Data["IsImageFile"] = commit.IsImageFile
- ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", endCommitID)
- ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", startCommitID)
- ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(headTarget, "raw", endCommitID)
+ ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", "commit", endCommitID)
+ ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", "commit", startCommitID)
+ ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(headTarget, "raw", "commit", endCommitID)
ctx.Data["RequireHighlightJS"] = true
ctx.HTML(200, tplPullFiles)
@@ -689,9 +689,9 @@ func PrepareCompareDiff(
ctx.Data["IsImageFile"] = headCommit.IsImageFile
headTarget := path.Join(headUser.Name, repo.Name)
- ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", headCommitID)
- ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", prInfo.MergeBase)
- ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(headTarget, "raw", headCommitID)
+ ctx.Data["SourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", "commit", headCommitID)
+ ctx.Data["BeforeSourcePath"] = setting.AppSubURL + "/" + path.Join(headTarget, "src", "commit", prInfo.MergeBase)
+ ctx.Data["RawPath"] = setting.AppSubURL + "/" + path.Join(headTarget, "raw", "commit", headCommitID)
return false
}
diff --git a/routers/repo/search.go b/routers/repo/search.go
index d755080adb..bf260ac8e4 100644
--- a/routers/repo/search.go
+++ b/routers/repo/search.go
@@ -38,7 +38,7 @@ func Search(ctx *context.Context) {
pager := paginater.New(total, setting.UI.RepoSearchPagingNum, page, 5)
ctx.Data["Page"] = pager
ctx.Data["SourcePath"] = setting.AppSubURL + "/" +
- path.Join(ctx.Repo.Repository.Owner.Name, ctx.Repo.Repository.Name, "src", ctx.Repo.Repository.DefaultBranch)
+ path.Join(ctx.Repo.Repository.Owner.Name, ctx.Repo.Repository.Name, "src", "branch", ctx.Repo.Repository.DefaultBranch)
ctx.Data["SearchResults"] = searchResults
ctx.Data["RequireHighlightJS"] = true
ctx.Data["PageIsViewCode"] = true