Skip to content

Fix Git.transform_kwarg #899

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

Merged
merged 1 commit into from
Jul 29, 2019
Merged

Fix Git.transform_kwarg #899

merged 1 commit into from
Jul 29, 2019

Conversation

FrNecas
Copy link
Contributor

@FrNecas FrNecas commented Jul 23, 2019

While working on our project I found that old_repo.git.rev_list('HEAD', max_parents=0) started to work differently after the new release of GitPython and our tests started to fail. After some debugging I found the problem. Kwargs were not transformed correctly if a value was set to 0 due to wrong if condition:

>>> 0 not in (False, None)
False
>>> 0 is not False and 0 is not None
True

The commit also contains a test for the edge case.

Kwargs were not transformed correctly if a value was set to 0 due to
wrong if condition.

Signed-off-by: František Nečas <[email protected]>
@Byron Byron added this to the v3.0.0 - Remove Python 2 milestone Jul 29, 2019
@Byron Byron merged commit daa3f35 into gitpython-developers:master Jul 29, 2019
@Byron
Copy link
Member

Byron commented Jul 29, 2019

Thanks a lot! Fantastic test and fix! I hope putting it into v3.0.0 which drops python 2 as well is working for you.

@FrNecas
Copy link
Contributor Author

FrNecas commented Jul 29, 2019

Thanks for merging. We will use my branch as a dependency until v3.0.0 is released on PyPI to have it working correctly for now and then we will switch back to the PyPI release.

@kangp3
Copy link

kangp3 commented Aug 13, 2019

Would it be possible to backport this fix to v2.X as well? We are relying on this package and unfortunately haven't dropped Python 2 support just yet.

@Byron
Copy link
Member

Byron commented Aug 14, 2019

@kangp3 Thus far, maintaining two versions wasn't planned, but I will see if I can get a one-off release done.

Published in release v2.1.14 .

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

Successfully merging this pull request may close these issues.

3 participants