Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork966
fix: fix incoherent beginning whitespace#1933
fix: fix incoherent beginning whitespace#1933Byron merged 3 commits intogitpython-developers:mainfromcardoeng:main
Conversation
Byron left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks a lot for this fix, that's better!
I wonder if thestrip("\n") has to happen at all, it's unusual to have newlines in paths anyway, and if they are there, they should not be removed.
In other words, what happens if there is nostrip() call?
cardoeng commentedJun 18, 2024
I tried removing the A |
Byron commentedJun 18, 2024
Thanks for trying it out, and it seems there is nothing left to do here but to hit merge. Thanks again for contributing :)! |
Some repositories contain files / directories beginning by a space in their history (example :react-component/field-form@0e81dc0).
The current version of GitPython returns this spacesometimes when doing a diff (depending on whether the space is in
a_pathorb_path).This is due to a
stripbeing done to the path (see the only line changed indiff.py). This PR make a simple change by not stripping the spaces, but only new lines (we can also add other characters if needed) so the behavior stays coherent and the white space is given when doing a diff. An alternative would be to remove thestrip(some tests started failing when doing so...).