Method: RJGit::Blob.new_from_string
- Defined in:
- lib/blob.rb
.new_from_string(repository, contents) ⇒ Object
65 66 67 68 69 70 |
# File 'lib/blob.rb', line 65 def self.new_from_string(repository, contents) repository = RJGit.repository_type(repository) blob_id = RJGit::Plumbing::TreeBuilder.new(repository).write_blob(contents, true) walk = RevWalk.new(repository) Blob.new(repository, REG_FILE_TYPE, nil, walk.lookup_blob(blob_id)) end |