summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-08 12:44:33 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-08-08 12:44:33 +0300
commitf4978bc08ea9fa4468d70eefaa32fd1eeafce5a9 (patch)
treefbd44cc23de65cfa6ad84ada2a2a29ef163d4d48
parent3f9b1d62effb576213e43f6ef9f55587ad3d9a67 (diff)
downloadgitlab-ce-f4978bc08ea9fa4468d70eefaa32fd1eeafce5a9.tar.gz
Fix unmerged diff for non-fork MR
-rw-r--r--app/models/merge_request.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index b3c7aa39cf8..9abdd41ec4e 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -152,7 +152,7 @@ class MergeRequest < ActiveRecord::Base
diffs = if for_fork?
Gitlab::Satellite::MergeAction.new(author, self).diffs_between_satellite
else
- Gitlab::Git::Diff.between(project.repository, source_branch, target_branch)
+ Gitlab::Git::Diff.between(target_project.repository, source_branch, target_branch)
end
diffs ||= []
@@ -195,6 +195,7 @@ class MergeRequest < ActiveRecord::Base
else
commits = target_project.repository.commits_between(self.target_branch, self.source_branch)
end
+
if commits.present?
commits = Commit.decorate(commits).
sort_by(&:created_at).