[go: up one dir, main page]

Skip to content

Allow only fast forward merges for a given branch of a repository

As a repository owner I should be able to specify that only Fast Forward merges are allowed for a given "XYZ" branch As a contributor to the repository I should only be allowed to perform Fast Forward merges to the "XYZ" branch.

Acceptance Criteria: this role should apply to the branch "XYZ" of the given repository this role should apply to any merge(pull) request done via git command this role should apply to any merge(pull) request done via the gitlab web UI if a contributor tries to perform a non Fast Forward merge into "XYZ" a error stating that only Fast Forward merges are allowed should be returned.

A possible way to implement this it would be to have repository owner set a flag similar to the Protected branches flag and in merge_action.rb merge_in_satellite toggle between repo.git.merge(default_options({no_ff: true}), "-m#{message}", "source/#{merge_request.source_branch}") and repo.git.merge(default_options({ff_only: true}), "-m#{message}", "source/#{merge_request.source_branch}") based on the branch setting