Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ruby 1.9 compatibility

* Add current directory to path for tests because 1.9 does not
* Explicity open file in binary mode to get around encoding issues
  • Loading branch information...
commit 0a80ba282d5864cb3e2ca5868291424932596ddd 1 parent 8869608
@cehoffman cehoffman authored mojombo committed
Showing with 2 additions and 2 deletions.
  1. +1 −1  Rakefile
  2. +1 −1  lib/grit/git-ruby/internal/loose.rb
View
2  Rakefile
@@ -47,7 +47,7 @@ task :default => :test
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
- test.libs << 'lib' << 'test'
+ test.libs << 'lib' << 'test' << '.'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
View
2  lib/grit/git-ruby/internal/loose.rb
@@ -29,7 +29,7 @@ def [](sha1)
begin
return nil unless sha1[0...2] && sha1[2..39]
path = @directory + '/' + sha1[0...2] + '/' + sha1[2..39]
- get_raw_object(File.read(path))
+ get_raw_object(open(path, 'rb') { |f| f.read })
rescue Errno::ENOENT
nil
end
Please sign in to comment.
Something went wrong with that request. Please try again.