You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package repo
  5. import "code.gitea.io/gitea/models/db"
  6. // MergeStyle represents the approach to merge commits into base branch.
  7. type MergeStyle string
  8. const (
  9. // MergeStyleMerge create merge commit
  10. MergeStyleMerge MergeStyle = "merge"
  11. // MergeStyleRebase rebase before merging
  12. MergeStyleRebase MergeStyle = "rebase"
  13. // MergeStyleRebaseMerge rebase before merging with merge commit (--no-ff)
  14. MergeStyleRebaseMerge MergeStyle = "rebase-merge"
  15. // MergeStyleSquash squash commits into single commit before merging
  16. MergeStyleSquash MergeStyle = "squash"
  17. // MergeStyleManuallyMerged pr has been merged manually, just mark it as merged directly
  18. MergeStyleManuallyMerged MergeStyle = "manually-merged"
  19. // MergeStyleRebaseUpdate not a merge style, used to update pull head by rebase
  20. MergeStyleRebaseUpdate MergeStyle = "rebase-update-only"
  21. )
  22. // UpdateDefaultBranch updates the default branch
  23. func UpdateDefaultBranch(repo *Repository) error {
  24. _, err := db.GetEngine(db.DefaultContext).ID(repo.ID).Cols("default_branch").Update(repo)
  25. return err
  26. }