Skip to content

Commit 01c95eb

Browse files
committed
Don't patch IndexObject and Object into git.objects.submodule.util
Such patching, which was introduced in 9519f18, seems no longer to be necessary. Since git.objects.submodule.util.__all__ has existed for a long time without including those names, they are not conceptually public attributes of git.objects.submodule.util, so they should not be in use by any code outside GitPython either. The modattrs.py script shows the change, as expected, showing these two names as no longer being in the git.objects.submodule.util module dictionary, in output of: python modattrs.py >b git diff --no-index a b However, because the removal is intentional, this is okay.
1 parent c58be4c commit 01c95eb

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

git/objects/__init__.py

-7
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,10 @@
88
from .base import * # noqa: F403
99
from .blob import * # noqa: F403
1010
from .commit import * # noqa: F403
11-
from .submodule import util as smutil
1211
from .submodule.base import * # noqa: F403
1312
from .submodule.root import * # noqa: F403
1413
from .tag import * # noqa: F403
1514
from .tree import * # noqa: F403
1615

17-
# Fix import dependency - add IndexObject to the util module, so that it can be imported
18-
# by the submodule.base.
19-
smutil.IndexObject = IndexObject # type: ignore[attr-defined] # noqa: F405
20-
smutil.Object = Object # type: ignore[attr-defined] # noqa: F405
21-
del smutil
22-
2316
# Must come after submodule was made available.
2417
__all__ = [name for name, obj in locals().items() if not (name.startswith("_") or inspect.ismodule(obj))]

0 commit comments

Comments
 (0)