diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-24 14:48:33 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-24 14:48:33 +0100 |
| commit | dc05e1ca72d4c7eec9e6aeb989c2aef35a33aab8 (patch) | |
| tree | 5cbfb0709ba88e79949a8b69ce2ef9de939928ea /test_utils/src/lib.rs | |
| parent | ab8785ef986b583dbded578c5b90435adfca526f (diff) | |
test: fix `pull` tests
it was so much clearer what the problem was after
abstracting reused test code
Diffstat (limited to 'test_utils/src/lib.rs')
| -rw-r--r-- | test_utils/src/lib.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index 087f849..866eafb 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs | |||
| @@ -1196,14 +1196,13 @@ pub fn remove_latest_commit_so_proposal_branch_is_behind_and_checkout_main( | |||
| 1196 | Ok(branch_name) | 1196 | Ok(branch_name) |
| 1197 | } | 1197 | } |
| 1198 | 1198 | ||
| 1199 | pub fn ammend_last_commit_and_checkout_main(test_repo: &GitTestRepo) -> Result<String> { | 1199 | pub fn amend_last_commit(test_repo: &GitTestRepo) -> Result<String> { |
| 1200 | let branch_name = | 1200 | let branch_name = |
| 1201 | remove_latest_commit_so_proposal_branch_is_behind_and_checkout_main(test_repo)?; | 1201 | remove_latest_commit_so_proposal_branch_is_behind_and_checkout_main(test_repo)?; |
| 1202 | // add another commit (so we have an ammened local branch) | 1202 | // add another commit (so we have an ammened local branch) |
| 1203 | test_repo.checkout(&branch_name)?; | 1203 | test_repo.checkout(&branch_name)?; |
| 1204 | std::fs::write(test_repo.dir.join("ammended-commit.md"), "some content")?; | 1204 | std::fs::write(test_repo.dir.join("ammended-commit.md"), "some content")?; |
| 1205 | test_repo.stage_and_commit("add ammended-commit.md")?; | 1205 | test_repo.stage_and_commit("add ammended-commit.md")?; |
| 1206 | test_repo.checkout("main")?; | ||
| 1207 | Ok(branch_name) | 1206 | Ok(branch_name) |
| 1208 | } | 1207 | } |
| 1209 | 1208 | ||