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
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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
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