libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.59k stars 383 forks source link

Equivalent of 'git diff ... -- paths' #1049

Closed jaanauati closed 3 years ago

jaanauati commented 3 years ago

This may be a dumb question, but not clear for me, what's the equivalent of git diff ... -- foo.txt?.

Thank you!

zomglings commented 3 years ago

@jaanauati : The way I do this with pygit2 is to navigate the Diff object returned by Repository.diff to get the hunks only for that file.

jaanauati commented 3 years ago

@zomglings I ended up doing it in that way. Thank you!.