Skip to content

git install doesn't recognize new main default branch #3366

Closed
python-poetry/poetry-core
#143
@wasdee

Description

poetry add git+https://github.com/AGeekInside/fastapi-jinja.git result in exception since it is tires to checkout master branch.

poetry add git+https://github.com/AGeekInside/fastapi-jinja.git

Updating dependencies
Resolving dependencies...

  CalledProcessError

  Command '['git', '--git-dir', 'C:/Users/n2/AppData/Local/Temp/pypoetry-git-fastapi-jinjau3blv69e/.git', '--work-tree', 'C:/Users/n2/AppData/Local/Temp/pypoetry-git-fastapi-jinjau3blv69e', 'checkout', 'master']' returned non-zero exit status 1.

  at ~\.poetry\lib\poetry\utils\_compat.py:217 in run
      213│                 process.wait()
      214│                 raise
      215│             retcode = process.poll()
      216│             if check and retcode:
    → 217│                 raise CalledProcessError(
      218│                     retcode, process.args, output=stdout, stderr=stderr
      219│                 )
      220│         finally:
      221│             # None because our context manager __exit__ does not use them.

as the default branch name has changed, poetry should both accept main and master.

the workaround is

  1. poetry add git+https://github.com/AGeekInside/fastapi-jinja.git#main
  2. pip install git+https://github.com/AGeekInside/fastapi-jinja.git

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions