git install doesn't recognize new main
default branch #3366
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
poetry add git+https://github.com/AGeekInside/fastapi-jinja.git#main
pip install git+https://github.com/AGeekInside/fastapi-jinja.git