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 | 152 | diffs = if for_fork? |
153 | 153 | Gitlab::Satellite::MergeAction.new(author, self).diffs_between_satellite |
154 | 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 | 156 | end |
157 | 157 | |
158 | 158 | diffs ||= [] |
... | ... | @@ -195,6 +195,7 @@ class MergeRequest < ActiveRecord::Base |
195 | 195 | else |
196 | 196 | commits = target_project.repository.commits_between(self.target_branch, self.source_branch) |
197 | 197 | end |
198 | + | |
198 | 199 | if commits.present? |
199 | 200 | commits = Commit.decorate(commits). |
200 | 201 | sort_by(&:created_at). | ... | ... |