Merge remote-tracking branch 'upstream/main' into limit-repo-size

This commit is contained in:
techknowlogick committed 2024-09-07 15:21:12 -04:00
commit 748dbd012f
2043 files changed
+66095 -81907

No files matched your search

+3 -6
View File
@@ -174,15 +174,11 @@ func initRepository(ctx context.Context, repoPath string, u *user_model.User, re
}
repo.DefaultBranch = setting.Repository.DefaultBranch
repo.DefaultWikiBranch = setting.Repository.DefaultBranch
if len(opts.DefaultBranch) > 0 {
repo.DefaultBranch = opts.DefaultBranch
gitRepo, err := gitrepo.OpenRepository(ctx, repo)
if err != nil {
return fmt.Errorf("openRepository: %w", err)
}
defer gitRepo.Close()
if err = gitRepo.SetDefaultBranch(repo.DefaultBranch); err != nil {
if err = gitrepo.SetDefaultBranch(ctx, repo, repo.DefaultBranch); err != nil {
return fmt.Errorf("setDefaultBranch: %w", err)
}
@@ -242,6 +238,7 @@ func CreateRepositoryDirectly(ctx context.Context, doer, u *user_model.User, opt
SizeLimit: opts.SizeLimit,
IsMirror: opts.IsMirror,
DefaultBranch: opts.DefaultBranch,
DefaultWikiBranch: setting.Repository.DefaultBranch,
ObjectFormatName: opts.ObjectFormatName,
}