Skip to content

Commit 6ee6a52

Browse files
Git::Path - Validates existence of absolute paths instead of relative onesi
Closes ruby-git#88
1 parent 9f795da commit 6ee6a52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/git/path.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ class Path
55
attr_accessor :path
66

77
def initialize(path, check_path=true)
8+
path = File.expand_path(path)
9+
810
if check_path && !File.exists?(path)
9-
raise ArgumentError, 'path does not exist', [File.expand_path(path)]
11+
raise ArgumentError, 'path does not exist', [path]
1012
end
1113

12-
@path = File.expand_path(path)
14+
@path = path
1315
end
1416

1517
def readable?

0 commit comments

Comments
 (0)