diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-10 23:35:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-10 23:35:17 +0800 |
commit | 7a3a90aca3c4a8258805efa10022a81e4d1a4d73 (patch) | |
tree | 54d92bac08a2aa336825cd1545dcd19fba028c96 /models/repo.go | |
parent | 3143bb10da25cd66383c23aff7b31dbd7c3dd9d6 (diff) | |
download | gitea-7a3a90aca3c4a8258805efa10022a81e4d1a4d73.tar.gz gitea-7a3a90aca3c4a8258805efa10022a81e4d1a4d73.zip |
Fix wrong original git service type on a migrated repository (#9693)
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/models/repo.go b/models/repo.go index 0dbdcc11b5..6c9623ea2c 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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, |