Commit f4978bc0 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix unmerged diff for non-fork MR

parent 3f9b1d62
...@@ -152,7 +152,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -152,7 +152,7 @@ class MergeRequest < ActiveRecord::Base
diffs = if for_fork? diffs = if for_fork?
Gitlab::Satellite::MergeAction.new(author, self).diffs_between_satellite Gitlab::Satellite::MergeAction.new(author, self).diffs_between_satellite
else else
Gitlab::Git::Diff.between(project.repository, source_branch, target_branch) Gitlab::Git::Diff.between(target_project.repository, source_branch, target_branch)
end end
diffs ||= [] diffs ||= []
...@@ -195,6 +195,7 @@ class MergeRequest < ActiveRecord::Base ...@@ -195,6 +195,7 @@ class MergeRequest < ActiveRecord::Base
else else
commits = target_project.repository.commits_between(self.target_branch, self.source_branch) commits = target_project.repository.commits_between(self.target_branch, self.source_branch)
end end
if commits.present? if commits.present?
commits = Commit.decorate(commits). commits = Commit.decorate(commits).
sort_by(&:created_at). sort_by(&:created_at).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment