diff --git a/app/models/pull_request.rb b/app/models/pull_request.rb index d1856dce1..843012cd5 100644 --- a/app/models/pull_request.rb +++ b/app/models/pull_request.rb @@ -180,6 +180,7 @@ class PullRequest < ActiveRecord::Base end def clone + return if from_project.nil? git = Grit::Git.new(path) if new_record? || !git.exist? #~ FileUtils.mkdir_p(path) diff --git a/app/views/projects/pull_requests/_pull_diff.html.haml b/app/views/projects/pull_requests/_pull_diff.html.haml index 3cec1ae3d..afbc97420 100644 --- a/app/views/projects/pull_requests/_pull_diff.html.haml +++ b/app/views/projects/pull_requests/_pull_diff.html.haml @@ -3,7 +3,8 @@ %a{name: "diff-#{pull_diff_counter}"} .top .l= h(pull_diff.renamed_file ? "#{pull_diff.a_path.rtruncate 60}=>#{pull_diff.b_path.rtruncate 60}" : pull_diff.b_path.rtruncate(120)) - .r= link_to "view file @ #{short_hash_id(commit_id)}", blob_path(@pull.from_project, commit_id, pull_diff.b_path) + - if @pull.from_project.present? + .r= link_to "view file @ #{short_hash_id(commit_id)}", blob_path(@pull.from_project, commit_id, pull_diff.b_path) .clear -if pull_diff.diff.present? && !(@pull.repo.tree(commit_id) / pull_diff.b_path).binary? .diff_data=render_diff(pull_diff, diff_counter: pull_diff_counter, comments: @comments)