diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-02-04 11:56:58 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-02-04 11:56:58 +0000 |
commit | b5befc734be55a4a7a07519baf03e0ba29c0f8c5 (patch) | |
tree | 5a40c945a29faf868e52ff52a4e7c66f15f5f2ed /app/models | |
parent | 9ae125e7e2c02ef6861f6fa09cc2d5048052a8ed (diff) | |
parent | c6e0228ca9937b10ad8e2620501d4fe221108d9a (diff) | |
download | gitlab-ce-b5befc734be55a4a7a07519baf03e0ba29c0f8c5.tar.gz |
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/models')
-rw-r--r-- | app/models/merge_request.rb | 3 |
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 |