Skip to content

Commit 1de5ad6

Browse files
lunnySysoev, Vladimir
authored and
Sysoev, Vladimir
committed
Fix download archiver of a commit (go-gitea#20962)
1 parent 20cc981 commit 1de5ad6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

modules/context/repo.go

+1
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context
987987
}
988988

989989
ctx.Data["BranchName"] = ctx.Repo.BranchName
990+
ctx.Data["RefName"] = ctx.Repo.RefName
990991
ctx.Data["BranchNameSubURL"] = ctx.Repo.BranchNameSubURL()
991992
ctx.Data["TagName"] = ctx.Repo.TagName
992993
ctx.Data["CommitID"] = ctx.Repo.CommitID

templates/repo/home.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@
121121
{{svg "octicon-download"}}
122122
<div class="menu">
123123
{{if not $.DisableDownloadSourceArchives}}
124-
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.BranchName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-3"}}{{.locale.Tr "repo.download_zip"}}</a>
125-
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.BranchName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-3"}}{{.locale.Tr "repo.download_tar"}}</a>
126-
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.BranchName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "mr-3"}}{{.locale.Tr "repo.download_bundle"}}</a>
124+
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-3"}}{{.locale.Tr "repo.download_zip"}}</a>
125+
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-3"}}{{.locale.Tr "repo.download_tar"}}</a>
126+
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.RefName}}.bundle" rel="nofollow">{{svg "octicon-package" 16 "mr-3"}}{{.locale.Tr "repo.download_bundle"}}</a>
127127
{{end}}
128128
<a class="item" href="vscode://vscode.git/clone?url={{$.RepoCloneLink.HTTPS}}">{{svg "gitea-vscode" 16 "mr-3"}}{{.locale.Tr "repo.clone_in_vsc"}}</a>
129129
</div>

0 commit comments

Comments
 (0)