From d366e45266bde2b5e9f993e8a96c3da8058d619b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 16 Oct 2019 00:53:09 +0800 Subject: [PATCH 1/2] fix migrate mirror 500 bug --- models/repo.go | 1 + 1 file changed, 1 insertion(+) diff --git a/models/repo.go b/models/repo.go index aa2cf06f326d..95656d5801fd 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1430,6 +1430,7 @@ func CreateRepository(doer, u *User, opts CreateRepoOptions) (_ *Repository, err IsFsckEnabled: !opts.IsMirror, CloseIssuesViaCommitInAnyBranch: setting.Repository.DefaultCloseIssuesViaCommitsInAnyBranch, Status: opts.Status, + IsEmpty: true, } sess := x.NewSession() From c9e7766797b628c44ead2b526a4f3ac2f03d1af0 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 16 Oct 2019 11:04:18 +0200 Subject: [PATCH 2/2] update backport --- models/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/repo.go b/models/repo.go index 95656d5801fd..d8a462c37bc0 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1430,7 +1430,7 @@ func CreateRepository(doer, u *User, opts CreateRepoOptions) (_ *Repository, err IsFsckEnabled: !opts.IsMirror, CloseIssuesViaCommitInAnyBranch: setting.Repository.DefaultCloseIssuesViaCommitsInAnyBranch, Status: opts.Status, - IsEmpty: true, + IsEmpty: !opts.AutoInit, } sess := x.NewSession()