Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
app/models/repository.rb
app/models/repository.rb
+1
-1
lib/gitlab/git/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