Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-02-04 14:56:58 +0300
committerDouwe Maan <douwe@gitlab.com>2016-02-04 14:56:58 +0300
commitb5befc734be55a4a7a07519baf03e0ba29c0f8c5 (patch)
tree5a40c945a29faf868e52ff52a4e7c66f15f5f2ed /app
parent9ae125e7e2c02ef6861f6fa09cc2d5048052a8ed (diff)
parentc6e0228ca9937b10ad8e2620501d4fe221108d9a (diff)
Merge branch 'disable-remove-source-branch' into 'master'
Hide remove source branch button when new commit is added to branch Fixes #3339 This MR hides the 'Remove source branch' button when a new commit is added to the source branch /cc @DouweM See merge request !2701
Diffstat (limited to 'app')
-rw-r--r--app/models/merge_request.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 2594a7e3578..ddc476447ca 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -284,7 +284,8 @@ class MergeRequest < ActiveRecord::Base
def can_remove_source_branch?(current_user)
!source_project.protected_branch?(source_branch) &&
!source_project.root_ref?(source_branch) &&
- Ability.abilities.allowed?(current_user, :push_code, source_project)
+ Ability.abilities.allowed?(current_user, :push_code, source_project) &&
+ last_commit == source_project.commit(source_branch)
end
def mr_and_commit_notes