Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

git_diff_find_similar doesn't always remove unmodified deltas#6642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethomson merged 3 commits intolibgit2:mainfromyori:yori/fix-remove-unmodified
Dec 21, 2023

Conversation

yori
Copy link
Contributor

@yoriyori commentedOct 7, 2023

Unmodified deltas are not always removed by git_diff_find_similar() when GIT_DIFF_FIND_REMOVE_UNMODIFIED is set. It only works correctly when a rename or copy is found in the diff. Somewhat understandably, this is the only case covered by the unit tests.

Non-blob deltas also avoid removal because of the way they are excluded as rename candidates. I've added a test for this using the "submodules" fixture. Maybe there's a simpler way to test for non-blob deltas?

yoriand others added3 commitsOctober 7, 2023 13:23
When finding similar deltas, count the targets that are tagged to be deleted.Apply deletions even in the absense of rewrites or updates.
When excluding non-blob deltas as potential rename sources, honour the“remove unmodified” option (if the delta is unmodified).
@ethomson
Copy link
Member

Thanks for this,@yori - and apologies for the delay, it took me a few read-throughs to remember the diff code and how it was all working together. This looks good to me. I think that we should pull the test out of the target handling, though, and into its own function.

(Since this took me so long to review, I just went ahead and made that change on top of your PR, I hope you don't mind. 🙏 )

Thanks again!

yori reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@yori@ethomson

[8]ページ先頭

©2009-2025 Movatter.jp