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
4ed23a3a
Commit
4ed23a3a
authored
Sep 22, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
So that st_commits could never be nil
parent
6987ec29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+6
-4
No files found.
app/models/merge_request_diff.rb
View file @
4ed23a3a
...
...
@@ -30,6 +30,10 @@ class MergeRequestDiff < ActiveRecord::Base
select
(
column_names
-
[
'st_diffs'
])
end
def
st_commits
super
||
[]
end
# Collect information about commits and diff from repository
# and save it to the database as serialized data
def
save_git_content
...
...
@@ -83,7 +87,7 @@ class MergeRequestDiff < ActiveRecord::Base
end
def
commits
@commits
||=
load_commits
(
st_commits
||
[]
)
@commits
||=
load_commits
(
st_commits
)
end
def
reload_commits
...
...
@@ -120,10 +124,8 @@ class MergeRequestDiff < ActiveRecord::Base
def
commits_sha
if
@commits
commits
.
map
(
&
:sha
)
elsif
st_commits
st_commits
.
map
{
|
commit
|
commit
[
:id
]
}
else
[]
st_commits
.
map
{
|
commit
|
commit
[
:id
]
}
end
end
...
...
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