← Winnitude! Search  ·  Reader Mode (1446 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 12 LINKS

`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, 2020

Check 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 assigned

    Labels


    acknowledged

    help wanted

    Type

    Bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions