Commit f4978bc08ea9fa4468d70eefaa32fd1eeafce5a9
1 parent
3f9b1d62
Exists in
master
and in
4 other branches
Fix unmerged diff for non-fork MR
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
app/models/merge_request.rb
| @@ -152,7 +152,7 @@ class MergeRequest < ActiveRecord::Base | @@ -152,7 +152,7 @@ class MergeRequest < ActiveRecord::Base | ||
| 152 | diffs = if for_fork? | 152 | diffs = if for_fork? |
| 153 | Gitlab::Satellite::MergeAction.new(author, self).diffs_between_satellite | 153 | Gitlab::Satellite::MergeAction.new(author, self).diffs_between_satellite |
| 154 | else | 154 | else |
| 155 | - Gitlab::Git::Diff.between(project.repository, source_branch, target_branch) | 155 | + Gitlab::Git::Diff.between(target_project.repository, source_branch, target_branch) |
| 156 | end | 156 | end |
| 157 | 157 | ||
| 158 | diffs ||= [] | 158 | diffs ||= [] |
| @@ -195,6 +195,7 @@ class MergeRequest < ActiveRecord::Base | @@ -195,6 +195,7 @@ class MergeRequest < ActiveRecord::Base | ||
| 195 | else | 195 | else |
| 196 | commits = target_project.repository.commits_between(self.target_branch, self.source_branch) | 196 | commits = target_project.repository.commits_between(self.target_branch, self.source_branch) |
| 197 | end | 197 | end |
| 198 | + | ||
| 198 | if commits.present? | 199 | if commits.present? |
| 199 | commits = Commit.decorate(commits). | 200 | commits = Commit.decorate(commits). |
| 200 | sort_by(&:created_at). | 201 | sort_by(&:created_at). |