diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-09-22 12:01:01 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-09-22 12:01:01 +0300 |
commit | 6987ec29b084ca842e46601965a60519fe96dc33 (patch) | |
tree | 066d1c6b2094411468087a8825cb4c6ecd25f848 /app/models/merge_request_diff.rb | |
parent | 73b4eecddecf1e86d5e0c26166e2027583b680cf (diff) |
For empty merge_request_diff st_commits would be nil
Closes #22438
Diffstat (limited to 'app/models/merge_request_diff.rb')
-rw-r--r-- | app/models/merge_request_diff.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 7362886e9f5..afa3611d044 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -120,8 +120,10 @@ class MergeRequestDiff < ActiveRecord::Base def commits_sha if @commits commits.map(&:sha) - else + elsif st_commits st_commits.map { |commit| commit[:id] } + else + [] end end |