Fix Git.transform_kwarg by FrNecas · Pull Request #899 · gitpython-developers/GitPython (original) (raw)

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.