(self,
repo_base_dir: str,
git_token: Optional[str],
url: str,
repo_name: str,
branch: Optional[str] = None)
| 110 | # Clone / pull / push |
| 111 | # ------------------------------------------------------------------ |
| 112 | def clone(self, |
| 113 | repo_base_dir: str, |
| 114 | git_token: Optional[str], |
| 115 | url: str, |
| 116 | repo_name: str, |
| 117 | branch: Optional[str] = None): |
| 118 | target = Path(repo_base_dir) / repo_name |
| 119 | try: |
| 120 | _GitCommand.clone( |
| 121 | url=url, target_dir=target, branch=branch, token=git_token) |
| 122 | except Exception as exc: |
| 123 | if (target / '.git').is_dir(): |
| 124 | logger.warning( |
| 125 | 'git clone exited non-zero but repository was cloned ' |
| 126 | 'at %s. Likely a post-clone hook. Continuing.', target) |
| 127 | return None |
| 128 | raise GitError(str(exc)) from exc |
| 129 | |
| 130 | def pull(self, |
| 131 | repo_dir: str, |
no test coverage detected