@@ -224,8 +224,7 @@ func generateRepoCommit(ctx context.Context, repo, templateRepo, generateRepo *r
224
224
}
225
225
}
226
226
227
- // FIXME: fix the hash
228
- if err := git .InitRepository (ctx , tmpDir , false , git .Sha1ObjectFormat .Name ()); err != nil {
227
+ if err := git .InitRepository (ctx , tmpDir , false , templateRepo .ObjectFormatName ); err != nil {
229
228
return err
230
229
}
231
230
@@ -327,18 +326,19 @@ func (gro GenerateRepoOptions) IsValid() bool {
327
326
// GenerateRepository generates a repository from a template
328
327
func GenerateRepository (ctx context.Context , doer , owner * user_model.User , templateRepo * repo_model.Repository , opts GenerateRepoOptions ) (_ * repo_model.Repository , err error ) {
329
328
generateRepo := & repo_model.Repository {
330
- OwnerID : owner .ID ,
331
- Owner : owner ,
332
- OwnerName : owner .Name ,
333
- Name : opts .Name ,
334
- LowerName : strings .ToLower (opts .Name ),
335
- Description : opts .Description ,
336
- DefaultBranch : opts .DefaultBranch ,
337
- IsPrivate : opts .Private ,
338
- IsEmpty : ! opts .GitContent || templateRepo .IsEmpty ,
339
- IsFsckEnabled : templateRepo .IsFsckEnabled ,
340
- TemplateID : templateRepo .ID ,
341
- TrustModel : templateRepo .TrustModel ,
329
+ OwnerID : owner .ID ,
330
+ Owner : owner ,
331
+ OwnerName : owner .Name ,
332
+ Name : opts .Name ,
333
+ LowerName : strings .ToLower (opts .Name ),
334
+ Description : opts .Description ,
335
+ DefaultBranch : opts .DefaultBranch ,
336
+ IsPrivate : opts .Private ,
337
+ IsEmpty : ! opts .GitContent || templateRepo .IsEmpty ,
338
+ IsFsckEnabled : templateRepo .IsFsckEnabled ,
339
+ TemplateID : templateRepo .ID ,
340
+ TrustModel : templateRepo .TrustModel ,
341
+ ObjectFormatName : templateRepo .ObjectFormatName ,
342
342
}
343
343
344
344
if err = CreateRepositoryByExample (ctx , doer , owner , generateRepo , false , false ); err != nil {
@@ -358,8 +358,7 @@ func GenerateRepository(ctx context.Context, doer, owner *user_model.User, templ
358
358
}
359
359
}
360
360
361
- // FIXME - fix the hash
362
- if err = CheckInitRepository (ctx , owner .Name , generateRepo .Name , git .Sha1ObjectFormat .Name ()); err != nil {
361
+ if err = CheckInitRepository (ctx , owner .Name , generateRepo .Name , generateRepo .ObjectFormatName ); err != nil {
363
362
return generateRepo , err
364
363
}
365
364
0 commit comments