Commit b0693318 authored by Rubén Dávila's avatar Rubén Dávila Committed by Robert Speicher
Browse files

Show list of branches plus some fixes.

parent 6b0e4783
......@@ -628,18 +628,16 @@ def revert(user, commit, base_branch, create_mr = false)
target_sha = find_branch(target_branch).try(:target)
# First make revert in temp branch
rm_branch(target_branch) if target_sha
rm_branch(user, target_branch) if target_sha
success = revert_commit(user, commit, target_branch, base_branch)
# Make the revert happen in the target branch
if success && !create_mr
source_sha = find_branch(target_branch).target
target_sha = find_branch(base_branch).target
has_changes = is_there_something_to_merge?(source_sha, target_sha)
source_sha = find_branch(target_branch).target
target_sha = find_branch(base_branch).target
has_changes = is_there_something_to_merge?(source_sha, target_sha)
if has_changes
success = revert_commit(user, commit, base_branch, base_branch)
end
if has_changes && !create_mr
success = revert_commit(user, commit, base_branch, base_branch)
end
has_changes && success
......
......@@ -9,7 +9,7 @@
.form-group.branch
= label_tag 'target_branch', 'Target branch', class: 'control-label'
.col-sm-10
= text_field_tag 'target_branch', nil, required: true, class: "form-control js-target-branch"
= select_tag "target_branch", grouped_options_refs, class: "select2 select2-sm js-target-branch"
- if can?(current_user, :push_code, @project)
.js-create-merge-request-container
.checkbox
......
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