Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/grit/git-ruby/internal/pack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
require 'grit/git-ruby/internal/raw_object'
require 'grit/git-ruby/internal/file_window'

PACK_SIGNATURE = "PACK"
PACK_IDX_SIGNATURE = "\377tOc"
PACK_IDX_SIGNATURE = [0xFF, 0x74, 0x4F, 0x63]

module Grit
module GitRuby
Expand Down Expand Up @@ -57,7 +56,7 @@ def with_idx(index_file = nil)
end

# read header
sig = idxfile.read(4)
sig = idxfile.read(4).unpack("C*")
ver = idxfile.read(4).unpack("N")[0]

if sig == PACK_IDX_SIGNATURE
Expand Down
2 changes: 1 addition & 1 deletion lib/grit/ruby1.9.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if ((defined? RUBY_VERSION) && (RUBY_VERSION[0..2] == "1.9"))
if ((defined? RUBY_VERSION) && (['1.9', '2.0'].include? RUBY_VERSION[0..2]))
class String
def getord(offset); self[offset].ord; end
def default_encoding!; force_encoding(Encoding.default_internal || Encoding::UTF_8); end
Expand Down