(self, ref: str)
| 141 | return True |
| 142 | |
| 143 | def update(self, ref: str) -> None: |
| 144 | tc_build.utils.print_header(f"Updating {self._pretty_name}") |
| 145 | |
| 146 | self.git(['fetch', 'origin']) |
| 147 | |
| 148 | if self.is_shallow() and not self.ref_exists(ref): |
| 149 | msg = f"Repo is shallow and supplied ref ('{ref}') does not exist!" |
| 150 | raise RuntimeError(msg) |
| 151 | |
| 152 | self.git(['checkout', ref]) |
| 153 | |
| 154 | local_ref = None |
| 155 | with contextlib.suppress(subprocess.CalledProcessError): |
| 156 | local_ref = self.git_capture(['symbolic-ref', '-q', 'HEAD']) |
| 157 | if local_ref and local_ref.startswith('refs/heads/'): |
| 158 | self.git(['pull', '--rebase', 'origin', local_ref.replace('refs/heads/', '')]) |
no test coverage detected