Commit dc38551b authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch '18377-cherry-pick-crashes-when-choosing-a-tag' into 'master'

Only show branches for revert / cherry-pick

## What does this MR do?

Stop showing tags in the revert and cherry-pick select options. You can't change a tag anyway.

## Are there points in the code the reviewer needs to double check?


## Why was this MR needed?

Showing tags doesn't make any sense and will just throw an exception if the user tries to cherry-pick or revert onto a tag.

## What are the relevant issue numbers?

Fixes #18377.

## Screenshots (if relevant)

On the GitLab CE repo:


## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG]( entry added
- [ ] [Documentation created/updated](
- [ ] API support added
- [ ] Tests
  - [x] Added for this feature/bug
  - [ ] All builds are passing
- [x] Conform by the [style guides](
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](

See merge request !4596
......@@ -10,6 +10,7 @@ v 8.9.0 (unreleased)
- Fix issue with arrow keys not working in search autocomplete dropdown
- Make EmailsOnPushWorker use Sidekiq mailers queue
- Fix wiki page events' webhook to point to the wiki repository
- Don't show tags for revert and cherry-pick operations
- Fix issue todo not remove when leave project !4150 (Long Nguyen)
- Allow customisable text on the 'nearly there' page after a user signs up
- Bump recaptcha gem to 3.0.0 to remove deprecated stoken support
......@@ -14,4 +14,8 @@ def can_push_branch?(project, branch_name), project).can_push_to_branch?(branch_name)
def project_branches
options_for_select(@project.repository.branch_names, @project.default_branch)
......@@ -17,7 +17,7 @@
= label_tag 'target_branch', target_label, class: 'control-label'
= select_tag "target_branch", grouped_options_refs, class: "select2 select2-sm js-target-branch"
= select_tag "target_branch", project_branches, class: "select2 select2-sm js-target-branch"
- if can?(current_user, :push_code, @project)
......@@ -16,6 +16,7 @@
it do
visit namespace_project_commit_path(project.namespace, project,
expect(page).not_to have_content('v1.0.0') # Only branches, not tags
page.within('#modal-cherry-pick-commit') do
uncheck 'create_merge_request'
click_button 'Cherry-pick'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment