initialise a git index from the contents of a commit