Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when processing diff with multiple renames. #76

Closed

Conversation

jameswalmsley
Copy link

Hi,

I found a bug, where diff's with multiple renames cause the "patchInfo" to be appended for each rename.
So each sucessive rename has its rename, plus all previous renames.

The diff I had the problem with is confidential, so I haven't created a test-case.
When you see the error, it should be obvious.

In anycase let me know if you want me to re-create another diff with the same issue.

Best

James

@jameswalmsley
Copy link
Author

Updated tests.. awaiting feedback.

@matiasb
Copy link
Owner

matiasb commented Feb 19, 2021

Thanks for the report and fix! I'll take a look in the coming days 👍

self.assertEqual(patch.added, 1)
self.assertEqual(patch.removed, 1)

self.assertEqual(len(res.modified_files), 4)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... shouldn't this be 2? Also I would expect we have 2 patch entries in res, right?

Copy link
Author

@jameswalmsley jameswalmsley Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering about this.
Currently the parser treats the renames as separate patches (with the fix I provided).

This behaviour works for my purposes, but I don't know what the real behaviour of the library should actually be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants