| 242 | |
| 243 | |
| 244 | def test_checkout_head(testrepo: Repository) -> None: |
| 245 | # some changes to the index |
| 246 | with (Path(testrepo.workdir) / 'bye.txt').open('w') as f: |
| 247 | f.write('new content') |
| 248 | testrepo.index.add('bye.txt') |
| 249 | |
| 250 | # checkout from index should not change anything |
| 251 | assert 'bye.txt' in testrepo.status() |
| 252 | testrepo.checkout(strategy=CheckoutStrategy.FORCE) |
| 253 | assert 'bye.txt' in testrepo.status() |
| 254 | |
| 255 | # checkout from head will reset index as well |
| 256 | testrepo.checkout('HEAD', strategy=CheckoutStrategy.FORCE) |
| 257 | assert 'bye.txt' not in testrepo.status() |
| 258 | |
| 259 | |
| 260 | def test_checkout_alternative_dir(testrepo: Repository) -> None: |