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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
30413fd2
Commit
30413fd2
authored
Aug 02, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rugged-is-ancestor' into 'master'
Add rugged_is_ancestor method See merge request !13232
parents
c955c3d5
d3ddc69b
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 @
30413fd2
...
@@ -944,7 +944,7 @@ class Repository
...
@@ -944,7 +944,7 @@ class Repository
if
is_enabled
if
is_enabled
raw_repository
.
is_ancestor?
(
ancestor_id
,
descendant_id
)
raw_repository
.
is_ancestor?
(
ancestor_id
,
descendant_id
)
else
else
merge_base_commit
(
ancestor_id
,
descendant_id
)
==
ancestor_id
rugged_is_ancestor?
(
ancestor_id
,
descendant_id
)
end
end
end
end
end
end
...
...
lib/gitlab/git/repository.rb
View file @
30413fd2
...
@@ -353,6 +353,13 @@ module Gitlab
...
@@ -353,6 +353,13 @@ module Gitlab
rugged
.
merge_base
(
from
,
to
)
rugged
.
merge_base
(
from
,
to
)
end
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
# Returns true is +from+ is direct ancestor to +to+, otherwise false
def
is_ancestor?
(
from
,
to
)
def
is_ancestor?
(
from
,
to
)
gitaly_commit_client
.
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