`repo.submodule('sort')` returns reference to IterableList.sort() method, not Submodule instance · Issue #1091 · gitpython-developers/GitPython
Repository navigation
repo.submodule('sort') returns reference to IterableList.sort() method, not Submodule instance #1091
New issue
New issue
Closed as not planned
Bug
Closed as not planned
repo.submodule('sort') returns reference to IterableList.sort() method, not Submodule instance #1091
Bug
Labels
acknowledged
help wanted
Description
@ryan-williams's profile ryan-williams opened on Nov 26, 2020Check out toy example repo w/ 2 submodules (named generate-random-ints and sort):
git clone --recurse-submodules https://gitlab.com/gsmo/examples/submodule-demo.git cd submodule-demo git checkout e6f6d8f git submodule update python
In Python REPL:
import git
repo = git.Repo()
repo.submodule('sort')
# <built-in method sort of IterableList object at 0x1058a7360>
repo.submodule('generate-random-ints')
# git.Submodule(name=generate-random-ints, path=generate-random-ints, url=https://gitlab.com/gsmo/examples/submodules/generate-random-ints.git, branch_path=refs/heads/master)
The submodule named sort can't be retrieved, as its name is shadowed by the IterableList.sort method.
Metadata
Metadata
Assignees
No one assignedLabels
acknowledged
help wanted