mirror of
https://github.com/go-gitea/gitea
synced 2025-08-06 01:28:20 +00:00
Refactor Pull Mirror and fix out-of-sync bugs (#24732)
The "mirror" table and "repository" table might be out-of-sync in some cases. It means that "IsMirror=true" but "Mirror=nil" This PR removes unnecessary "Mirror" field, rename "Mirror" to "PullMirror" and fix nil panic bug. Screenshot of changed templates:  
This commit is contained in:
@@ -39,8 +39,8 @@
|
||||
<a class="rss-icon gt-ml-3" href="{{$.RepoLink}}.rss" data-tooltip-content="{{$.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{if $.IsPullMirror}}
|
||||
{{$address := MirrorRemoteAddress $.Context . $.Mirror.GetRemoteName false}}
|
||||
{{if $.PullMirror}}
|
||||
{{$address := MirrorRemoteAddress $.Context . $.PullMirror.GetRemoteName false}}
|
||||
<div class="fork-flag">{{$.locale.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$address.Address}}">{{$address.Address}}</a></div>
|
||||
{{end}}
|
||||
{{if .IsFork}}<div class="fork-flag">{{$.locale.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}}
|
||||
|
Reference in New Issue
Block a user