Class: Gollum::Git::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/grit_adapter/git_layer_grit.rb

Instance Method Summary collapse

Constructor Details

#initialize(index) ⇒ Index

Returns a new instance of Index.


236
237
238
239
240
# File 'lib/grit_adapter/git_layer_grit.rb', line 236

def initialize(index)
  @index = index
  @tree = Gollum::Git::Tree.new(@index.tree)
  @current_tree = nil
end

Instance Method Details

#add(path, data) ⇒ Object


246
247
248
# File 'lib/grit_adapter/git_layer_grit.rb', line 246

def add(path, data)
  @index.add(path, data)
end

#commit(message, parents = nil, actor = nil, last_tree = nil, head = 'master') ⇒ Object

index.commit(@options, parents, actor, nil, @wiki.ref)


251
252
253
# File 'lib/grit_adapter/git_layer_grit.rb', line 251

def commit(message, parents = nil, actor = nil, last_tree = nil, head = 'master')
  @index.commit(message, parents, actor, last_tree, head)
end

#current_treeObject


264
265
266
# File 'lib/grit_adapter/git_layer_grit.rb', line 264

def current_tree
  @current_tree
end

#delete(path) ⇒ Object


242
243
244
# File 'lib/grit_adapter/git_layer_grit.rb', line 242

def delete(path)
  @index.delete(path)
end

#read_tree(id) ⇒ Object


259
260
261
262
# File 'lib/grit_adapter/git_layer_grit.rb', line 259

def read_tree(id)
  @index.read_tree(id)
  @current_tree = Gollum::Git::Tree.new(@index.current_tree)
end

#treeObject


255
256
257
# File 'lib/grit_adapter/git_layer_grit.rb', line 255

def tree
  @index.tree
end