fails to install from git repo when commit doesn't belong to a branch
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
-  If an exception occurs when executing a command, I executed it again in debug mode (-vvvoption).
- OS version and name: windows 10
- Poetry version: 1.1.12
- Link of a Gist with the contents of your pyproject.toml file: https://github.com/KotlinIsland/basedtyping/blob/master/pyproject.toml
Issue
https://github.com/KotlinIsland/basedtyping/runs/4741756977?check_suite_focus=true
  Stack trace:
  8  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:203 in _execute_operation
      201β 
      202β             try:
    β 203β                 result = self._do_execute_operation(operation)
      204β             except EnvCommandError as e:
      205β                 if e.e.returncode == -2:
  7  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:277 in _do_execute_operation
      275β             return 0
      276β 
    β 277β         result = getattr(self, "_execute_{}".format(method))(operation)
      278β
      279β         if result != 0:
  6  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:412 in _execute_install
      410β 
      411β     def _execute_install(self, operation):  # type: (Install) -> None
    β 412β         return self._install(operation)
      413β
      414β     def _execute_update(self, operation):  # type: (Update) -> None
  5  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:431 in _install
      429β 
      430β         if package.source_type == "git":
    β 431β             return self._install_git(operation)
      432β
      433β         if package.source_type == "file":
  4  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\installation\executor.py:576 in _install_git
      574β             reference = package.source_reference
      575β 
    β 576β         git.checkout(reference, src_dir)
      577β
      578β         # Now we just need to install from the source directory
  3  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\core\vcs\git.py:281 in checkout
      279β         args += ["checkout", rev]
      280β
    β 281β         return self.run(*args)
      282β
      283β     def rev_parse(self, rev, folder=None):  # type: (str, Optional[Path]) -> str
  2  ~\.local\pipx\venvs\poetry\lib\site-packages\poetry\core\vcs\git.py:356 in run
      354β 
      355β         return decode(
    β 356β             subprocess.check_output(
      357β                 [executable()] + list(args), stderr=subprocess.STDOUT
      358β             )
  1  ~\AppData\Local\Programs\Python\Python310\lib\subprocess.py:420 in check_output
       418β         kwargs['input'] = empty
       419β 
    β  420β     return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
       421β                **kwargs).stdout
       422β
  CalledProcessError
  Command '['C:\\Program Files\\Git\\cmd\\git.exe', '--git-dir', 'C:/Users/user/basedtyping/.venv/src/basedmypy/.git', '--work-tree', 'C:/Users/user/basedtyping/.venv/src/basedmypy', 'checkout', 'e5d40fc37d8d6eca75d8784020d82b4574b042b7']' returned non-zero exit status 128.
  at ~\.local\pipx\venvs\poetry\lib\site-packages\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.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:20 (11 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
git push a commit that doesn't belong to any branch
Your problem is not Git, but a pre-receive hook on the server that apparently checks that the commit is referenced by a branch....
Read more >Git error - Fatal: Not a git repository and how to fix it | Datree.io
This error means you attempted to run a Git command, but weren't inside a Git repository. Make sure you've: Navigated to the right...
Read more >How to Fix the βfatal: not a git repositoryβ Error - ContainIQ
Check that you correctly created the repo. If the directory doesn't contain a .git repo, use git init to properly initialize the repo...
Read more >Git happens! 6 Common Git mistakes and how to fix them
Whether you added the wrong file, committed directly to master, or some other mishap, we've got you covered.
Read more >Branches in a Nutshell - Git SCM
The default branch name in Git is master . As you start making commits, you're given a master branch that points to the...
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

@LVladymyr The linked PR is in 1.2 milestone so there was no stable release of poetry with the fix yet. It should not be reproducible in latest 1.2.0 beta release.
Resolved-by: #5428