Skip to content

Fix Git.transform_kwarg - #899

Merged
Byron merged 1 commit into
gitpython-developers:masterfrom
FrNecas:frnecas-kwargs
Jul 29, 2019
Merged

Fix Git.transform_kwarg#899
Byron merged 1 commit into
gitpython-developers:masterfrom
FrNecas:frnecas-kwargs

Conversation

@FrNecas

Copy link
Copy Markdown
Contributor

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 <fifinecas@seznam.cz>
@ByronByron added this to the v3.0.0 - Remove Python 2 milestone Jul 29, 2019
@Byron
Byron merged commit daa3f35 into gitpython-developers:masterJul 29, 2019
@Byron

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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
Copy Markdown

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

Byron commented Aug 14, 2019

Copy link
Copy Markdown
Member

@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 freeto 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

@FrNecas@Byron@kangp3