(barerepo: Repository)
| 190 | |
| 191 | |
| 192 | def test_amend_commit_tree(barerepo: Repository) -> None: |
| 193 | repo = barerepo |
| 194 | commit = repo[COMMIT_SHA_TO_AMEND] |
| 195 | assert isinstance(commit, Commit) |
| 196 | assert commit.id == repo.head.target |
| 197 | |
| 198 | tree = '967fce8df97cc71722d3c2a5930ef3e6f1d27b12' |
| 199 | tree_prefix = tree[:5] |
| 200 | |
| 201 | amended_oid = repo.amend_commit(commit, 'HEAD', tree=tree_prefix) |
| 202 | amended_commit = repo[amended_oid] |
| 203 | assert isinstance(amended_commit, Commit) |
| 204 | assert isinstance(commit, Commit) |
| 205 | |
| 206 | assert repo.head.target == amended_oid |
| 207 | assert ObjectType.COMMIT.value == amended_commit.type |
| 208 | assert commit.message == amended_commit.message |
| 209 | assert commit.author == amended_commit.author |
| 210 | assert commit.committer == amended_commit.committer |
| 211 | assert commit.tree_id != amended_commit.tree_id |
| 212 | assert Oid(hex=tree) == amended_commit.tree_id |
| 213 | |
| 214 | |
| 215 | def test_amend_commit_not_tip_of_branch(barerepo: Repository) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…