Skip to content
Snippets Groups Projects
Commit d3ddc69b authored by Jacob Vosmaer's avatar Jacob Vosmaer :wave:
Browse files

Add rugged_is_ancestor method

parent 1a0e176b
No related branches found
No related tags found
Loading
......@@ -944,7 +944,7 @@ def is_ancestor?(ancestor_id, descendant_id)
if is_enabled
raw_repository.is_ancestor?(ancestor_id, descendant_id)
else
merge_base_commit(ancestor_id, descendant_id) == ancestor_id
rugged_is_ancestor?(ancestor_id, descendant_id)
end
end
end
......
......@@ -353,6 +353,13 @@ def merge_base_commit(from, to)
rugged.merge_base(from, to)
end
# Gitaly note: JV: check gitlab-ee before removing this method.
def rugged_is_ancestor?(ancestor_id, descendant_id)
return false if ancestor_id.nil? || descendant_id.nil?
merge_base_commit(ancestor_id, descendant_id) == ancestor_id
end
# Returns true is +from+ is direct ancestor to +to+, otherwise false
def is_ancestor?(from, to)
gitaly_commit_client.is_ancestor(from, to)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment