I'm using Grit to create a repo and committing as few times. Every time I commit, my commit is saved, but the old one disappears. Anyone have any clue what I'm doing wrong?
First I create a repo and make a commit. If I log the commit, I get the commit ID, and everything works
repo_name = 'repos/myrepo.git'
repo = Repo.init_bare(repo_name)
index = Index.new(repo)
index.add('mytext.txt', "This is my first text")
index.commit('Text commit')
Then I do another commit
index = repo.index
index.read_tree('master')
index.add('mytext.txt', "This is my second text")
index.commit('Text commit')
.. and when I do a git log, only the last commit shows up. This following line returns 1
repo.commits.count
Any idea what I'm doing wrong? I can't really find any tutorials on how to use the write methods in Grit. So any links would also be appreciated. Thanks!