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
Boxiang Sun
gitlab-ce
Commits
d5b1d0ea
Commit
d5b1d0ea
authored
Oct 17, 2016
by
Grzegorz Bizon
Committed by
Annabel Dunstone Gray
Oct 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use temporary compare commits when MR not persisted
parent
f7da5065
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
app/models/merge_request.rb
app/models/merge_request.rb
+9
-11
No files found.
app/models/merge_request.rb
View file @
d5b1d0ea
...
...
@@ -787,21 +787,19 @@ class MergeRequest < ActiveRecord::Base
def
all_pipelines
return
unless
source_project
@all_pipelines
||=
begin
sha
=
if
persisted?
all_commits_sha
else
diff_head_sha
end
source_project
.
pipelines
.
order
(
id: :desc
).
where
(
sha:
sha
,
ref:
source_branch
)
end
@all_pipelines
||=
source_project
.
pipelines
.
where
(
sha:
all_commits_sha
,
ref:
source_branch
)
.
order
(
id: :desc
)
end
# Note that this could also return SHA from now dangling commits
#
def
all_commits_sha
merge_request_diffs
.
flat_map
(
&
:commits_sha
).
uniq
if
persisted?
merge_request_diffs
.
flat_map
(
&
:commits_sha
).
uniq
else
compare_commits
.
reverse
.
map
(
&
:id
)
end
end
def
merge_commit
...
...
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