File tree 2 files changed +10
-17
lines changed
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) {
380
380
ctx .Data ["Permission" ] = & ctx .Repo .Permission
381
381
382
382
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 {
397
385
ctx .Repo .Mirror .Repo = repo
386
+ ctx .Data ["IsPullMirror" ] = true
398
387
ctx .Data ["MirrorEnablePrune" ] = ctx .Repo .Mirror .EnablePrune
399
388
ctx .Data ["MirrorInterval" ] = ctx .Repo .Mirror .Interval
400
389
ctx .Data ["Mirror" ] = ctx .Repo .Mirror
390
+ } else if err != repo_model .ErrMirrorNotExist {
391
+ ctx .ServerError ("GetMirrorByRepoID" , err )
392
+ return
401
393
}
402
394
}
403
395
Original file line number Diff line number Diff line change 37
37
{{end}}
38
38
</div>
39
39
</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}}
43
44
{{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{.BaseRepo.FullName}}</a></div>{{end}}
44
45
{{if .IsGenerated}}<div class="fork-flag">{{$.i18n.Tr "repo.generated_from"}} <a href="{{.TemplateRepo.Link}}">{{.TemplateRepo.FullName}}</a></div>{{end}}
45
46
</div>
You can’t perform that action at this time.
0 commit comments