File tree Expand file tree Collapse file tree 2 files changed +10
-17
lines changed
Expand file tree Collapse file tree 2 files changed +10
-17
lines changed Original file line number Diff line number Diff line change @@ -380,24 +380,16 @@ func repoAssignment(ctx *Context, repo *repo_model.Repository) {
380380 ctx .Data ["Permission" ] = & ctx .Repo .Permission
381381
382382 if repo .IsMirror {
383-
384- // Check if the mirror has finsihed migrationg, only then we can
385- // lookup the mirror informtation the database.
386- finishedMigrating , err := models .HasFinishedMigratingTask (repo .ID )
387- if err != nil {
388- ctx .ServerError ("HasFinishedMigratingTask" , err )
389- return
390- }
391- if finishedMigrating {
392- ctx .Repo .Mirror , err = repo_model .GetMirrorByRepoID (ctx , repo .ID )
393- if err != nil {
394- ctx .ServerError ("GetMirrorByRepoID" , err )
395- return
396- }
383+ ctx .Repo .Mirror , err = repo_model .GetMirrorByRepoID (ctx , repo .ID )
384+ if err == nil {
397385 ctx .Repo .Mirror .Repo = repo
386+ ctx .Data ["IsPullMirror" ] = true
398387 ctx .Data ["MirrorEnablePrune" ] = ctx .Repo .Mirror .EnablePrune
399388 ctx .Data ["MirrorInterval" ] = ctx .Repo .Mirror .Interval
400389 ctx .Data ["Mirror" ] = ctx .Repo .Mirror
390+ } else if err != repo_model .ErrMirrorNotExist {
391+ ctx .ServerError ("GetMirrorByRepoID" , err )
392+ return
401393 }
402394 }
403395
Original file line number Diff line number Diff line change 3737 {{end }}
3838 </div>
3939 </div>
40- {{if .IsMirror }}
41- {{$address := MirrorRemoteAddress $ .Context . $ .Mirror.GetRemoteName }}
42- <div class= " fork-flag" >{{$ .i18n.Tr " repo.mirror_from" }} <a target= " _blank" rel= " noopener noreferrer" href= " {{$address.Address}}" >{{$address .Address }}</a></div>{{end }}
40+ {{if $ .IsPullMirror }}
41+ {{$address := MirrorRemoteAddress $ .Context . $ .Mirror.GetRemoteName }}
42+ <div class= " fork-flag" >{{$ .i18n.Tr " repo.mirror_from" }} <a target= " _blank" rel= " noopener noreferrer" href= " {{$address.Address}}" >{{$address .Address }}</a></div>
43+ {{end }}
4344 {{if .IsFork }}<div class= " fork-flag" >{{$ .i18n.Tr " repo.forked_from" }} <a href= " {{.BaseRepo.Link}}" >{{.BaseRepo.FullName }}</a></div>{{end }}
4445 {{if .IsGenerated }}<div class= " fork-flag" >{{$ .i18n.Tr " repo.generated_from" }} <a href= " {{.TemplateRepo.Link}}" >{{.TemplateRepo.FullName }}</a></div>{{end }}
4546 </div>
You can’t perform that action at this time.
0 commit comments