(self)
| 473 | raise e |
| 474 | |
| 475 | def Checkout(self): |
| 476 | if VERBOSE: |
| 477 | print('Checking out {n} in {d}'.format(n=self.name, d=self.repo_dir)) |
| 478 | |
| 479 | if os.path.exists(os.path.join(self.repo_dir, '.git')): |
| 480 | url_changed = command_output(['git', 'config', '--get', 'remote.origin.url'], self.repo_dir).strip() != self.url |
| 481 | else: |
| 482 | url_changed = False |
| 483 | |
| 484 | if self._args.do_clean_repo or url_changed: |
| 485 | if os.path.isdir(self.repo_dir): |
| 486 | if VERBOSE: |
| 487 | print('Clearing directory {d}'.format(d=self.repo_dir)) |
| 488 | shutil.rmtree(self.repo_dir, onerror = on_rm_error) |
| 489 | if not os.path.exists(os.path.join(self.repo_dir, '.git')): |
| 490 | self.Clone() |
| 491 | self.Fetch() |
| 492 | if len(self._args.ref): |
| 493 | command_output(['git', 'checkout', self._args.ref], self.repo_dir) |
| 494 | else: |
| 495 | command_output(['git', 'checkout', self.commit], self.repo_dir) |
| 496 | |
| 497 | if VERBOSE: |
| 498 | print(command_output(['git', 'status'], self.repo_dir)) |
| 499 | |
| 500 | |
| 501 | def DownloadAndExtractArtifact(self): |
no test coverage detected