Method: GitDS::StageIndex#initialize
- Defined in:
- lib/git-ds/index.rb
#initialize(repo, treeish = nil) ⇒ StageIndex
Returns a new instance of StageIndex.
156 157 158 159 160 161 162 163 |
# File 'lib/git-ds/index.rb', line 156 def initialize(repo, treeish=nil) super(repo) @parent_commit = repo.commits(repo.current_branch, 1).first treeish = (@parent_commit ? @parent_commit.tree.id : 'master') if \ not treeish read_tree(treeish) @sha = self.current_tree.id end |