Skip to content

Commit 58c9d12

Browse files
A pull-mirror repo should be marked as such on creation (#19295)
Right now, a pull-mirror repo does not get marked as such until *after* the mirroring completes. In the meantime, it will show up (in API and UI) as a regular repo.
1 parent 65f17bf commit 58c9d12

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

integrations/mirror_pull_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func TestMirrorPull(t *testing.T) {
4646
Status: repo_model.RepositoryBeingMigrated,
4747
})
4848
assert.NoError(t, err)
49+
assert.True(t, mirrorRepo.IsMirror, "expected pull-mirror repo to be marked as a mirror immediately after its creation")
4950

5051
ctx := context.Background()
5152

modules/repository/create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func CreateRepository(doer, u *user_model.User, opts models.CreateRepoOptions) (
5454
Status: opts.Status,
5555
IsEmpty: !opts.AutoInit,
5656
TrustModel: opts.TrustModel,
57+
IsMirror: opts.IsMirror,
5758
}
5859

5960
var rollbackRepo *repo_model.Repository

0 commit comments

Comments
 (0)