rust-lang / git2-rs

libgit2 bindings for Rust
https://docs.rs/git2
Apache License 2.0
1.64k stars 380 forks source link

how can i see changes in merge request? #1005

Open lpf763827726 opened 6 months ago

lpf763827726 commented 6 months ago

i try to use diff to check source_branch and target_branch last commit, at first, it seemed like everything was normal

but when i try to use revert, diff will keep the revert changes in

my steps:

  1. create aaa in master
  2. create branch dev
  3. create bbb in dev
  4. create merge dev -> master
  5. merged it and revert it
  6. create ccc in dev
  7. create merge dev -> master again

follow this steps, i can't use diff in here, i check diff in this source and target branch last commit, it have 'bbb' and 'ccc' in the same time, but if i try it in git bash, it only have 'ccc'

i was use repo.diff_tree_to_tree and diff.deltas().enumerate()

i don't know is it something wrong with my code, or it really can't use diff in here, please get some suggestions, thank you.