@@ -27,23 +27,23 @@ import (
27
27
28
28
// CreateRepoOptions contains the create repository options
29
29
type CreateRepoOptions struct {
30
- Name string
31
- Description string
32
- OriginalURL string
33
- GitServiceType api.GitServiceType
34
- Gitignores string
35
- IssueLabels string
36
- License string
37
- Readme string
38
- DefaultBranch string
39
- IsPrivate bool
40
- IsMirror bool
41
- IsTemplate bool
42
- AutoInit bool
43
- Status repo_model.RepositoryStatus
44
- TrustModel repo_model.TrustModelType
45
- MirrorInterval string
46
- ObjectFormat git. ObjectFormat
30
+ Name string
31
+ Description string
32
+ OriginalURL string
33
+ GitServiceType api.GitServiceType
34
+ Gitignores string
35
+ IssueLabels string
36
+ License string
37
+ Readme string
38
+ DefaultBranch string
39
+ IsPrivate bool
40
+ IsMirror bool
41
+ IsTemplate bool
42
+ AutoInit bool
43
+ Status repo_model.RepositoryStatus
44
+ TrustModel repo_model.TrustModelType
45
+ MirrorInterval string
46
+ ObjectFormatName string
47
47
}
48
48
49
49
func prepareRepoCommit (ctx context.Context , repo * repo_model.Repository , tmpDir , repoPath string , opts CreateRepoOptions ) error {
@@ -135,7 +135,7 @@ func prepareRepoCommit(ctx context.Context, repo *repo_model.Repository, tmpDir,
135
135
136
136
// InitRepository initializes README and .gitignore if needed.
137
137
func initRepository (ctx context.Context , repoPath string , u * user_model.User , repo * repo_model.Repository , opts CreateRepoOptions ) (err error ) {
138
- if err = repo_module .CheckInitRepository (ctx , repo .OwnerName , repo .Name , opts .ObjectFormat ); err != nil {
138
+ if err = repo_module .CheckInitRepository (ctx , repo .OwnerName , repo .Name , opts .ObjectFormatName ); err != nil {
139
139
return err
140
140
}
141
141
@@ -210,10 +210,6 @@ func CreateRepositoryDirectly(ctx context.Context, doer, u *user_model.User, opt
210
210
opts .DefaultBranch = setting .Repository .DefaultBranch
211
211
}
212
212
213
- if opts .ObjectFormat == nil {
214
- opts .ObjectFormat = git.Sha1ObjectFormat {}
215
- }
216
-
217
213
// Check if label template exist
218
214
if len (opts .IssueLabels ) > 0 {
219
215
if _ , err := repo_module .LoadTemplateLabelsByDisplayName (opts .IssueLabels ); err != nil {
@@ -239,7 +235,7 @@ func CreateRepositoryDirectly(ctx context.Context, doer, u *user_model.User, opt
239
235
TrustModel : opts .TrustModel ,
240
236
IsMirror : opts .IsMirror ,
241
237
DefaultBranch : opts .DefaultBranch ,
242
- ObjectFormat : opts .ObjectFormat ,
238
+ ObjectFormatName : opts .ObjectFormatName ,
243
239
}
244
240
245
241
var rollbackRepo * repo_model.Repository
0 commit comments