Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork960
Commit24c4a0e
committed
__init__: don't run refresh on import
Consumers of gitpython may not need to use it in all use cases, and maywant to be able to run (without using gitpython) in environments wheregit is not available on PATH. While this can be worked around by settingthe GIT_PYTHON_REFRESH environment variable, adding special handling forgitpython means that it can't be imported just like everything else inan import block at the top of the module, and environment variables havepotentially undesired propagation behaviour.Previously, it was also nontrivial to distinguish gitpython failing toimport because of missing git or because e.g. gitpython isn't installedat all, because the exception that's raised is an ImportError withoutfurther qualification (except in the error message).Thus, we now no longer perform `refresh` at the module top level,instead performing it lazily when an invocation of git is attempted.This also allows some functionality that doesn't rely on the git commandto work without, e.g. ref listing.1 parent2d4c541 commit24c4a0e
4 files changed
+20
-6
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
5 | 18 |
| |
6 | 19 |
| |
7 | 20 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
292 | 292 |
| |
293 | 293 |
| |
294 | 294 |
| |
295 |
| - | |
296 |
| - | |
297 |
| - | |
298 |
| - | |
299 |
| - | |
300 | 295 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
857 | 857 |
| |
858 | 858 |
| |
859 | 859 |
| |
860 |
| - | |
| 860 | + | |
861 | 861 |
| |
862 | 862 |
| |
863 | 863 |
| |
| |||
1575 | 1575 |
| |
1576 | 1576 |
| |
1577 | 1577 |
| |
| 1578 | + | |
| 1579 | + | |
1578 | 1580 |
| |
1579 | 1581 |
| |
1580 | 1582 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + |
0 commit comments
Comments
(0)