Skip to content

Stop stringifying None in clone kwargs #784

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

Closed
nvllsvm opened this issue Jul 26, 2018 · 0 comments
Closed

Stop stringifying None in clone kwargs #784

nvllsvm opened this issue Jul 26, 2018 · 0 comments

Comments

@nvllsvm
Copy link
Contributor

nvllsvm commented Jul 26, 2018

Kwargs to git.Repo.clone and git.Repo.clone_from with None values get cast to strings and passed to the git command. This leads to behavior I'd consider non-Pythonic as it's exposing a Python internal null value to something which has no understanding of it.

For example, git.Repo.clone_from(url, path, mirror=None) results git clone --mirror=None -v url path. This is not valid as --mirror takes no arguments.

Instead, a None value should result in one of two things in the git command:

  • Exclude the kwarg entirely
  • Include the kwarg, but treat it as a flag without arguments (ex. --mirror without the =).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant