Skip to content

Commit

Permalink
Prevent 500 on draft releases without tag
Browse files Browse the repository at this point in the history
It is possible to create draft releases prior to creating a tag. This will cause a
500 on the releases page due to compare page failing.

This PR only shows the compare button if there is a SHA1 present.

Fix #16610

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Aug 5, 2021
1 parent fd39e6d commit cdeb962
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion templates/repo/release/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
<a class="mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
</span>
{{end}}
{{template "repo/branch_dropdown" dict "root" $ "release" .}}
{{if .Sha1 }}
{{template "repo/branch_dropdown" dict "root" $ "release" .}}
{{end}}
{{end}}
</div>
<div class="ui twelve wide column detail">
Expand Down

0 comments on commit cdeb962

Please sign in to comment.