Method: Gitgo::Index::ShaFile#write
- Defined in:
- lib/gitgo/index/sha_file.rb
#write(sha) ⇒ Object
Writes the sha to the file at the current index. Multiple shas may be written at once by providing a string of concatenated shas.
117 118 119 120 121 122 123 124 |
# File 'lib/gitgo/index/sha_file.rb', line 117 def write(sha) unless sha.length % ENTRY_SIZE == 0 raise "invalid sha length: #{sha.length}" end file.write [sha].pack(PACK) self end |