def _resolve_main_path(self) -> Optional[Path]:
        """
        Resolve the path of this git repo, unless this repo is a git submodule,
        then resolve the path of the main git repo.
        """
        proc, captured_stdout = self._exec(
            "rev-parse", "--show-superproject-working-tree", "--show-toplevel"
        )
        if proc.returncode == 0:
            return Path(captured_stdout.decode().strip().split("\n")[0])
        return None

        Resolve the path of this git repo, unless this repo is a git submodule,
        then resolve the path of the main git repo.
        
poethepoet/helpers/git.py