Test updating symbolic reference in transaction.
(testrepo: Repository)
| 89 | |
| 90 | |
| 91 | def test_transaction_symbolic_ref(testrepo: Repository) -> None: |
| 92 | """Test updating symbolic reference in transaction.""" |
| 93 | with testrepo.transaction() as txn: |
| 94 | txn.lock_ref('HEAD') |
| 95 | txn.set_symbolic_target('HEAD', 'refs/heads/i18n', message='Switch HEAD') |
| 96 | |
| 97 | head = testrepo.lookup_reference('HEAD') |
| 98 | assert head.target == 'refs/heads/i18n' |
| 99 | |
| 100 | # Restore HEAD to master |
| 101 | with testrepo.transaction() as txn: |
| 102 | txn.lock_ref('HEAD') |
| 103 | txn.set_symbolic_target('HEAD', 'refs/heads/master', message='Restore HEAD') |
| 104 | |
| 105 | |
| 106 | def test_transaction_remove_ref(testrepo: Repository) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…