diff --git a/app/controllers/projects/pull_requests_controller.rb b/app/controllers/projects/pull_requests_controller.rb index f2b4eb0cd..dda62cee0 100644 --- a/app/controllers/projects/pull_requests_controller.rb +++ b/app/controllers/projects/pull_requests_controller.rb @@ -16,10 +16,12 @@ class Projects::PullRequestsController < Projects::BaseController @pull.base_ref = @pull.base_project.default_branch @pull.head_ref = params[:treeish].presence || @pull.head_project.default_branch - @base_commit = @pull.base_project.git_repository.commits(@base_ref).first - @head_commit = @pull.head_project.git_repository.commits(@head_ref).first @pull.check - #@pull.save + + repo = Git::Repository.new(@pull.path) + @base_commit = repo.commits(@pull.base_ref).first + @head_commit = repo.commits(@pull.head_ref).first + @diff = Grit::Repo.new(@pull.path).diff @base_commit, @head_commit end diff --git a/app/views/projects/pull_requests/new.html.haml b/app/views/projects/pull_requests/new.html.haml index f2176fa47..66b5bdd0e 100644 --- a/app/views/projects/pull_requests/new.html.haml +++ b/app/views/projects/pull_requests/new.html.haml @@ -32,7 +32,6 @@ .rightlist=f.submit t('.submit'), :class => 'btn btn-primary disabled', 'data-loading-text' => t('layout.processing'), :id => 'create_pull' .both #diff.tab-pane - =@head_commit -begin =# render_commit_stats(stats)