benthayer / git-gud

Wanna git gud? Then get git-gud, and git gud at git!
MIT License
401 stars 42 forks source link

Update Operator to get contents of commit files #288

Closed sahansk2 closed 3 years ago

sahansk2 commented 3 years ago

We'd like to have a common method to get the contents of a file in a commit, something like

def commit_content(self, commit, filepath)

since this is pretty crucial for level development in #238.

commit could support taking a Commit object, or a string commit-ish.

filepath should support taking Path objects and string representations of paths.

benthayer commented 3 years ago

This is pretty similar to the implementation of #286 .

We should also be wary of reading the data stream, which can only be read from once.