Fix rename change type & support 'change in type'#755
Fix rename change type & support 'change in type'#755Byron merged 2 commits intogitpython-developers:masterfrom
Conversation
Byron
left a comment
There was a problem hiding this comment.
Thanks a lot for your contribution. Something stuck out that I think needs fixing.
After that I am happy to merge.
git/diff.py
Outdated
| # Change type can be R100 | ||
| # R: status letter | ||
| # 100: score (in case of copy and rename) | ||
| change_type = change_type[0] |
There was a problem hiding this comment.
This one is interesting: change_type is reassigned, and thus just a single character. One line later, change_type is treated as the original string to get the score, which probably is always empty now.
| self.assertEqual(diff.rename_from, None) | ||
| self.assertEqual(diff.rename_to, None) | ||
| self.assertEqual(diff.change_type, 'T') | ||
| self.assertEqual(len(list(diffs.iter_change_type('T'))), 1) |
There was a problem hiding this comment.
I think a test for score is missing. It's likely to not work in the current implementation.
Also store the rename score
Codecov Report
@@ Coverage Diff @@
## master #755 +/- ##
==========================================
+ Coverage 94.67% 94.68% +<.01%
==========================================
Files 59 59
Lines 9322 9339 +17
==========================================
+ Hits 8826 8843 +17
Misses 496 496
Continue to review full report at Codecov.
|
|
oh sorry, I didn't red this old commit correctly, it was not finished.... I fixed it. |
Byron
left a comment
There was a problem hiding this comment.
Thanks so much for the quick fix and your contribution.
I will cut a new release now.
|
glad to see this issue solved |
Hello,
It fixes #563, we now parse correctly the change type and store the score if given. I didn't manage to create a copied status in my git so I didn't support it for now. Hope I will find some time later to give another try.
Regards,
Aurélien