From eb9ce477237f1468a2d147b0e7733c1e5b5b73fc Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 24 Jun 2013 20:54:50 +0600 Subject: [PATCH] pull diff small refactoring --- .gitignore | 1 + app/views/projects/pull_requests/_pull_diff.html.haml | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 69fc58944..f98b0074d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ crash.log config/newrelic.yml config/deploy/*.rb config/deploy.rb +*.swo diff --git a/app/views/projects/pull_requests/_pull_diff.html.haml b/app/views/projects/pull_requests/_pull_diff.html.haml index 60fbe55ff..baf8b9ece 100644 --- a/app/views/projects/pull_requests/_pull_diff.html.haml +++ b/app/views/projects/pull_requests/_pull_diff.html.haml @@ -2,9 +2,8 @@ .file %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.a_path.rtruncate(120)) - - if pull_diff.b_path.present? - .r= link_to "view file @ #{short_hash_id(commit_id)}", blob_path(@project, commit_id, pull_diff.b_path) + .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(@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)