summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-01-10 23:35:17 +0800
committerGitHub <noreply@github.com>2020-01-10 23:35:17 +0800
commit7a3a90aca3c4a8258805efa10022a81e4d1a4d73 (patch)
tree54d92bac08a2aa336825cd1545dcd19fba028c96 /models/repo.go
parent3143bb10da25cd66383c23aff7b31dbd7c3dd9d6 (diff)
downloadgitea-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.go24
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,