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
diff options
context:
space:
mode:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-09-19 14:31:51 +0300
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-10-10 01:20:45 +0300
commit2de8fc3e13b64dfc50e872486aad0c33b35df8a6 (patch)
tree6dbb9f9f04e352eeccaa8548ed99bb37c209e3e9 /app/models/repository.rb
parent4e963fed42ad518caa7353d361a38a1250c99c41 (diff)
removes inconsistency regarding tagging immediately as merged once you create a branch using new branch button and adds changelog entry
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index bf59b74495b..1bf6e58b9db 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -1013,13 +1013,17 @@ class Repository
branch_commit = commit(branch_name)
root_ref_commit = commit(root_ref)
- if branch_commit
+ if branch_commit && !same_head?(branch_commit.id, root_ref_commit.id)
is_ancestor?(branch_commit.id, root_ref_commit.id)
else
nil
end
end
+ def same_head?(first_commit_id, second_commit_id)
+ first_commit_id == second_commit_id
+ end
+
def merge_base(first_commit_id, second_commit_id)
first_commit_id = commit(first_commit_id).try(:id) || first_commit_id
second_commit_id = commit(second_commit_id).try(:id) || second_commit_id