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
b44000ab
Commit
b44000ab
authored
Jun 22, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly include the common ancestor
parent
108c4766
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
app/models/merge_request.rb
app/models/merge_request.rb
+9
-6
No files found.
app/models/merge_request.rb
View file @
b44000ab
...
...
@@ -610,9 +610,12 @@ class MergeRequest < ActiveRecord::Base
end
end
# This is common ancestor
def
common_ancestor_commit
source_project
.
repository
.
commit
(
first_commit
.
sha
).
parents
.
first
end
def
source_sha_parent
source_project
.
repository
.
commit
(
first_commit
.
sha
).
parents
.
firs
t
.
sha
common_ancestor_commi
t
.
sha
end
def
ff_merge_possible?
...
...
@@ -623,11 +626,11 @@ class MergeRequest < ActiveRecord::Base
def
commits_from_common_ancestor
target_project
.
repository
.
commits_between
(
source_sha_parent
,
# Use parent of the common ancestor because from commit was hidden:
# Ref: https://gitlab.com/gitlab-org/gitlab_git/commit/a89ba3f2e5295702d7159fa8dba7ec3decd8935b#52f38738e1ad943a852c4c55bc5c708582443d10_245_214
common_ancestor_commit
.
parents
.
first
.
sha
,
last_commit
.
sha
).
unshift
(
source_sha_parent
)
# We want the from commit (common ancestor):
# Ref: https://gitlab.com/gitlab-org/gitlab_git/commit/a89ba3f2e5295702d7159fa8dba7ec3decd8935b#52f38738e1ad943a852c4c55bc5c708582443d10_245_214
)
end
def
should_be_rebased?
...
...
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