Checkout the specified commit.
(config: EvoGitConfig, commit: str)
| 517 | |
| 518 | |
| 519 | def checkout(config: EvoGitConfig, commit: str) -> None: |
| 520 | """Checkout the specified commit.""" |
| 521 | # -q is quiet, --detach is used to checkout the commit in detached HEAD mode |
| 522 | subprocess.run( |
| 523 | ["git", "checkout", "-q", "--detach", commit], |
| 524 | cwd=config.git_dir, |
| 525 | check=True, |
| 526 | stdout=subprocess.DEVNULL, |
| 527 | stderr=subprocess.DEVNULL, |
| 528 | ) |
| 529 | |
| 530 | |
| 531 | def add_temp_worktree(config: EvoGitConfig, branch: str) -> str: |