mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 19:06:18 +01:00 
			
		
		
		
	Add merge style fast-forward-only (#28954)
				
					
				
			With this option, it is possible to require a linear commit history with the following benefits over the next best option `Rebase+fast-forward`: The original commits continue existing, with the original signatures continuing to stay valid instead of being rewritten, there is no merge commit, and reverting commits becomes easier. Closes #24906
This commit is contained in:
		| @@ -65,6 +65,7 @@ func getRepoEditOptionFromRepo(repo *repo_model.Repository) *api.EditRepoOption | ||||
| 	allowRebase := false | ||||
| 	allowRebaseMerge := false | ||||
| 	allowSquash := false | ||||
| 	allowFastForwardOnly := false | ||||
| 	if unit, err := repo.GetUnit(db.DefaultContext, unit_model.TypePullRequests); err == nil { | ||||
| 		config := unit.PullRequestsConfig() | ||||
| 		hasPullRequests = true | ||||
| @@ -73,6 +74,7 @@ func getRepoEditOptionFromRepo(repo *repo_model.Repository) *api.EditRepoOption | ||||
| 		allowRebase = config.AllowRebase | ||||
| 		allowRebaseMerge = config.AllowRebaseMerge | ||||
| 		allowSquash = config.AllowSquash | ||||
| 		allowFastForwardOnly = config.AllowFastForwardOnly | ||||
| 	} | ||||
| 	archived := repo.IsArchived | ||||
| 	return &api.EditRepoOption{ | ||||
| @@ -92,6 +94,7 @@ func getRepoEditOptionFromRepo(repo *repo_model.Repository) *api.EditRepoOption | ||||
| 		AllowRebase:               &allowRebase, | ||||
| 		AllowRebaseMerge:          &allowRebaseMerge, | ||||
| 		AllowSquash:               &allowSquash, | ||||
| 		AllowFastForwardOnly:      &allowFastForwardOnly, | ||||
| 		Archived:                  &archived, | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user