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.
pull/19273/head^2
Peter Gardfjäll 3 years ago committed by GitHub
parent 65f17bfc31
commit 58c9d12933
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      integrations/mirror_pull_test.go
  2. 1
      modules/repository/create.go

@ -46,6 +46,7 @@ func TestMirrorPull(t *testing.T) {
Status: repo_model.RepositoryBeingMigrated, Status: repo_model.RepositoryBeingMigrated,
}) })
assert.NoError(t, err) assert.NoError(t, err)
assert.True(t, mirrorRepo.IsMirror, "expected pull-mirror repo to be marked as a mirror immediately after its creation")
ctx := context.Background() ctx := context.Background()

@ -54,6 +54,7 @@ func CreateRepository(doer, u *user_model.User, opts models.CreateRepoOptions) (
Status: opts.Status, Status: opts.Status,
IsEmpty: !opts.AutoInit, IsEmpty: !opts.AutoInit,
TrustModel: opts.TrustModel, TrustModel: opts.TrustModel,
IsMirror: opts.IsMirror,
} }
var rollbackRepo *repo_model.Repository var rollbackRepo *repo_model.Repository

Loading…
Cancel
Save