Skip to content

Commit 4badc19

Browse files
committed
Fix git.index imports
- Add the base, fun, typ, and util Python submodules of git.index to git.index.__all__ to restore the old behavior. - Import them explicitly for clarity, even though they are bound to the same-named attributes of git.index either way. This should help human readers know what the entries in __all__ are referring to, and may also help some automated tools. This is a preliminary decision and not necessarily the one that will ultimately be taken in this import refactoring. It *may* cause some kinds of mistakes, such as those arising from ill-advised use of wildcard imports in production code *outside* GitPython, somewhat worse in their effects. - Remove the ab.diff file that showed the problem this solves. This resolves the problem deliberately introduced in the previous incomplete commit, which modattrs.py output and test_imports test results confirm.
1 parent fc86a23 commit 4badc19

File tree

2 files changed

+5
-30
lines changed

2 files changed

+5
-30
lines changed

Diff for: ab.diff

-30
This file was deleted.

Diff for: git/index/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"""Initialize the index package."""
55

66
__all__ = [
7+
"base",
8+
"fun",
9+
"typ",
10+
"util",
711
"BaseIndexEntry",
812
"BlobFilter",
913
"CheckoutError",
@@ -12,5 +16,6 @@
1216
"StageType",
1317
]
1418

19+
from . import base, fun, typ, util
1520
from .base import CheckoutError, IndexFile
1621
from .typ import BaseIndexEntry, BlobFilter, IndexEntry, StageType

0 commit comments

Comments
 (0)