Open yehaha9876 opened 8 years ago
Yup. I just ran into this. First of all, it was broken completely if you didn't pass either an other
or an options
. But it's still counter-intuitive that calling commit.diff
will return a diff of that commit being reverted, not applied. Worse still, if you get the commit.diff
of the first commit, it somehow automatically swaps things, and returns a forward diff (as you would expect). https://github.com/libgit2/rugged/pull/798 fixes both issues - you can call it with no args, while preserving the current behavior if you explicitly pass something to compare it to (especially since this is how Repository#diff is implemented)
I use walker find a commit but when i get it`s diff, i think the result is wrong.
rugged/lib/rugged/commit.rb
rugged/lib/rugged/tree.rb
but rugged/ext/rugged/rugged_tree.c
so all seams right, but as the comment say
The +tree+ object will be used as the "old file" side of the diff, while the parent tree or the +diffable+ object will be used for the "new file" side
, is parent used as new side right?