Commit 522eb179 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'klowner/gitlab-ce-fix-compare-by-tag-crash' into 'master'

Fix 500 error when comparing by tags

_Originally opened at !2787 by @klowner._

- - -

Fixes #13171.
Fixes #13370.

See merge request !2849
parents cbb45195 e9e01bcd
...@@ -611,6 +611,8 @@ class Repository ...@@ -611,6 +611,8 @@ class Repository
end end
def merge_base(first_commit_id, second_commit_id) 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
rugged.merge_base(first_commit_id, second_commit_id) rugged.merge_base(first_commit_id, second_commit_id)
rescue Rugged::ReferenceError rescue Rugged::ReferenceError
nil nil
......
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