From 5c7f9d69e3db27921acf6d8259245f2b4babcc2b Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 22 Feb 2017 09:10:32 -0600 Subject: Fix code for cops --- lib/gitlab/diff/position.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lib/gitlab/diff') diff --git a/lib/gitlab/diff/position.rb b/lib/gitlab/diff/position.rb index 81c93f1aab5..fc728123c97 100644 --- a/lib/gitlab/diff/position.rb +++ b/lib/gitlab/diff/position.rb @@ -140,15 +140,16 @@ module Gitlab def find_diff_file(repository) # We're at the initial commit, so just get that as we can't compare to anything. - compare = if Gitlab::Git.blank_ref?(start_sha) - Gitlab::Git::Commit.find(repository.raw_repository, head_sha) - else - Gitlab::Git::Compare.new( - repository.raw_repository, - start_sha, - head_sha - ) - end + compare = + if Gitlab::Git.blank_ref?(start_sha) + Gitlab::Git::Commit.find(repository.raw_repository, head_sha) + else + Gitlab::Git::Compare.new( + repository.raw_repository, + start_sha, + head_sha + ) + end diff = compare.diffs(paths: paths).first -- cgit v1.2.3