GitPython icon indicating copy to clipboard operation
GitPython copied to clipboard

Potential bug on `import git`

Open pared opened this issue 6 years ago • 1 comments

On import git GitPython calls git 2 times, upon running refresh method. Those calls have potential of being a bug source since the user has no way of providing environmental variables for git. For example, if the user decides to provide the PATH variable for any method utilizing the env variable (eg clone_from), he/she might end up using different git than has been used during import.

pared avatar Sep 30 '19 13:09 pared

Absolutely true, it is impossible to control the environment for these git calls. A potential workaround for this case would be to configure the environment of the python process to be the 'best fit for most cases', even though this might still not be enough.

Maybe it's possible to alter the python global env dict prior to importing GitPython, too.

Byron avatar Sep 30 '19 14:09 Byron