BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d3ddc69b
Commit
d3ddc69b
authored
Aug 01, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rugged_is_ancestor method
parent
1a0e176b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
repository.rb
app/models/repository.rb
+1
-1
repository.rb
lib/gitlab/git/repository.rb
+7
-0
No files found.
app/models/repository.rb
View file @
d3ddc69b
...
...
@@ -944,7 +944,7 @@ class Repository
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
...
...
lib/gitlab/git/repository.rb
View file @
d3ddc69b
...
...
@@ -353,6 +353,13 @@ module Gitlab
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment