Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork937
fix: fix incoherent beginning whitespace#1933
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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?
I tried removing the
A |
Thanks for trying it out, and it seems there is nothing left to do here but to hit merge. Thanks again for contributing :)! |
4c21e51
intogitpython-developers:mainUh oh!
There was an error while loading.Please reload this page.
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_path
orb_path
).This is due to a
strip
being 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...).