class GitDS::StageMemIndex

In-memory staging index.

This replaces the StageIndex#build method with a nop, so that the index is not written to disk.

This is primarily useful in transactions or in methods such as Database#batch. Keepin the tree in-memory as long as necessary reduces disk writes and speeds up bulk insert/delete operations.

Public Instance Methods

build() click to toggle source

Return the sha of the stage index on disk. This DOES NOT synchronize the in-memory index with the on-disk index.

# File lib/git-ds/index.rb, line 248
def build
  return @sha
end
force_sync() click to toggle source

Force a sync-to-disk. This is used by batch mode to ensure a sync.

# File lib/git-ds/index.rb, line 261
def force_sync
  self.read_tree(self.write)
  @repo.exec_in_git_dir { `git read-tree #{@sha}` }
end
sync() click to toggle source

Replace standard sync with a no-op.

# File lib/git-ds/index.rb, line 255
def sync
end