I'm trying to wrap my head around using Grit to write to a Git repository. I can easily create a repo and make a commit:
repo = Repo.init_bare("grit.git")
index = Index.new(repo)
index.add('myfile.txt', 'This is the content')
index.commit('first commit')
I can also easily make the second commit, using the first commit as parent:
index.add('myotherfile.txt', 'This is some other content')
index.commit("second commit", [repo.commits.first])
But now how do I get the content of those 2 files without traversing through the entire commit history? Isn't there a smarter way for me to get the current state of the files in a repo?