Method: Gitdb::Card#write_to_stage

Defined in:
lib/gitdb/Card.rb

#write_to_stage(id, content) ⇒ Object

[View source]

113
114
115
116
117
# File 'lib/gitdb/Card.rb', line 113

def write_to_stage id, content
  oid = @repo.write content, :blob
  @repo.index.read_tree @repo.head.target.tree unless @repo.branches.count == 0
  @repo.index.add :path => id, :oid => oid, :mode => 0100644
end