git2-rs icon indicating copy to clipboard operation
git2-rs copied to clipboard

possible to perform git diff [path1] [path2]?

Open nasifimtiazohi opened this issue 4 years ago • 1 comments

Hi,

I see Diff is only achievable through some diff_* functions on the Repository structure. However, my goal is to compare two different source code repository which is possible through git native command git diff [path1] [path2]. Is there a way to get similar results through this crate?

nasifimtiazohi avatar Jun 23 '21 00:06 nasifimtiazohi

Might be better late than never, but you probably want to use Patch to get the necessary information between the two paths. You could either get the two Blobs from each repository and use from_blobs – but I could be wrong, I'm not sure how the lifetimes would lineup 🤔

FintanH avatar Mar 04 '25 17:03 FintanH