Repository navigation
Combine modified and renamed behaviour to allow for modified + renamed - #9
Merged
Merged
Conversation
If a file was both modified and renamed between the two versions, then it was treated as just a rename. Whilst the patch contents would still be correct, only the contents of fileB would be downloaded (presumably as an optimisation, since in a pure rename the contents would be identical), and were used for both fileA and fileB. This would mean that when comparing fileA and fileB in the case of a rename + modify, that the modification would be lost. This unifies the logic for modify and rename, but handles the differing filenames in the rename case. It has the cost of an extra getContent request for pure renames.
Owner
|
@stuartherring good points - and thanks for the PR! Correct code is generally better than performant code, so I'm also ok with the extra getContent request in this case. One thing though - in the documented API it only returns a previousFilename if the filename has been renamed - but in this case it's returning it for every modified file - in order to avoid a breaking change, would you be able to adjust the logic so that the API remains the same? |
Contributor
Author
|
No worries, PR updated |
alex-e-leon
approved these changes
Mar 6, 2019
Owner
|
Thanks for the contribution @stuartherring - published in v1.3.3 |
Contributor
Author
|
No worries, thanks for looking at it so quickly! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a file was both modified and renamed between the two versions, then
it was treated as just a rename.
Whilst the patch contents would still be correct, only the contents of
fileB would be downloaded (presumably as an optimisation, since in a
pure rename the contents would be identical), and were used for both
fileA and fileB.
This would mean that when comparing fileA and fileB in the case of a
rename + modify, that the modification would be lost.
This unifies the logic for modify and rename, but handles the differing
filenames in the rename case.
It has the cost of an extra getContent request for pure renames.