Skip to content

Commit 7eeff8c

Browse files
committed
Do not use Pathname to detect the git directory.
Pathname#expand_path doesn't actually expand the path if the target doesn't exist.
1 parent 2cb2c63 commit 7eeff8c

File tree

1 file changed

+1
-2
lines changed
  • lib/code_climate/test_reporter

1 file changed

+1
-2
lines changed

lib/code_climate/test_reporter/git.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module CodeClimate
22
module TestReporter
33
class Git
4-
require "pathname"
54

65
class << self
76
def info
@@ -52,7 +51,7 @@ def git(command)
5251
def git_dir
5352
root = "."
5453

55-
if defined?(Rails) && Pathname(Rails.root).expand_path(".git").directory?
54+
if defined?(Rails) && File.directory?(File.expand_path(".git", Rails.root))
5655
root = Rails.root
5756
end
5857

0 commit comments

Comments
 (0)