Diff::CommitDiff should be implemented in Gitaly-Ruby
https://gitlab.com/gitlab-org/gitlab-ce/issues/41258#note_52138695
In that comparison, and
git diff f3a3bd50eafdcfcaeea21d6cfa0b8bbae7720fec...10065d4599ac73711a8558f1ba2f4ac8dbe5927a -- app/assets/javascripts/repo/components/commit_sidebar/list.vue app/assets/javascripts/ide/components/commit_sidebar/list.vue
, the rename is not detected, so we see the files separately. By default, Git only detects a rename if the two files have at least 50% similarity. In this case, there were some changes, and similarity is only 34%.
Ultimately
Gitlab::Diff::Position#find_diff_file
ends up inGitlab::Git::Repository#diff
, which switches between a Gitaly and Rugged implementation based on thegitaly_diff_between
feature. I think these two implementations are returning different results! My guess is that Gitaly wrapsgit diff
, and is returning the created and deleted file separately, not detecting the rename because the similarity is lower than 50%, while Rugged has useslibgit2
with, perhaps, a lower threshold.