1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix wrong original git service type on a migrated repository (#9693)

This commit is contained in:
Lunny Xiao
2020-01-10 23:35:17 +08:00
committed by GitHub
parent 3143bb10da
commit 7a3a90aca3
7 changed files with 76 additions and 44 deletions

View File

@@ -1071,17 +1071,18 @@ func initRepoCommit(tmpPath string, repo *Repository, u *User) (err error) {
// CreateRepoOptions contains the create repository options
type CreateRepoOptions struct {
Name string
Description string
OriginalURL string
Gitignores string
IssueLabels string
License string
Readme string
IsPrivate bool
IsMirror bool
AutoInit bool
Status RepositoryStatus
Name string
Description string
OriginalURL string
GitServiceType structs.GitServiceType
Gitignores string
IssueLabels string
License string
Readme string
IsPrivate bool
IsMirror bool
AutoInit bool
Status RepositoryStatus
}
func getRepoInitFile(tp, name string) ([]byte, error) {
@@ -1369,6 +1370,7 @@ func CreateRepository(doer, u *User, opts CreateRepoOptions) (_ *Repository, err
LowerName: strings.ToLower(opts.Name),
Description: opts.Description,
OriginalURL: opts.OriginalURL,
OriginalServiceType: opts.GitServiceType,
IsPrivate: opts.IsPrivate,
IsFsckEnabled: !opts.IsMirror,
CloseIssuesViaCommitInAnyBranch: setting.Repository.DefaultCloseIssuesViaCommitsInAnyBranch,