update file_blob_in_diff method
This commit is contained in:
parent
a67f108572
commit
2c5f8ee065
|
@ -89,7 +89,8 @@ module CommitHelper
|
||||||
|
|
||||||
def file_blob_in_diff(repo, commit_id, diff)
|
def file_blob_in_diff(repo, commit_id, diff)
|
||||||
tree = repo.tree(commit_id)
|
tree = repo.tree(commit_id)
|
||||||
diff.renamed_file ? (tree / diff.b_path) : (tree / (diff.a_path.presence || diff.b_path))
|
blob = diff.renamed_file ? (tree / diff.b_path) : (tree / (diff.a_path.presence || diff.b_path))
|
||||||
|
blob || diff.a_blob || diff.b_blob
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_commit_id_for_file(diff, commit, parent_commit)
|
def get_commit_id_for_file(diff, commit, parent_commit)
|
||||||
|
|
|
@ -32,6 +32,4 @@
|
||||||
== render 'file_removed_not_changed', blob: blob
|
== render 'file_removed_not_changed', blob: blob
|
||||||
|
|
||||||
- elsif !blob.binary?
|
- elsif !blob.binary?
|
||||||
- if (@project.repo.tree(commit_id) / diff.b_path).nil?
|
|
||||||
= "a_path=#{diff.a_path}; b_path=#{diff.b_path}"
|
|
||||||
== render_diff(diff, diff_counter: diff_counter, comments: @comments)
|
== render_diff(diff, diff_counter: diff_counter, comments: @comments)
|
||||||
|
|
Loading…
Reference in New Issue