From 41ebdea4155bcf319f991df1158efa9ef6db0f3e Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sat, 2 Oct 2021 23:03:36 -0700 Subject: [PATCH] tests: update a test to not point a branch to an unreachable commit The next patch would otherwise make this test fail because "transaction 2" tries to point a branch to a commit that's not visible (because it's created by the concurrent "transaction 1"). --- lib/tests/test_view.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tests/test_view.rs b/lib/tests/test_view.rs index a525e4fa7..62f3a808a 100644 --- a/lib/tests/test_view.rs +++ b/lib/tests/test_view.rs @@ -184,6 +184,8 @@ fn test_merge_views_branches() { testutils::create_random_commit(&settings, &repo).write_to_repo(mut_repo); let main_branch_origin_tx0 = testutils::create_random_commit(&settings, &repo).write_to_repo(mut_repo); + let main_branch_origin_tx1 = + testutils::create_random_commit(&settings, &repo).write_to_repo(mut_repo); let main_branch_alternate_tx0 = testutils::create_random_commit(&settings, &repo).write_to_repo(mut_repo); mut_repo.set_local_branch( @@ -211,8 +213,6 @@ fn test_merge_views_branches() { let mut tx1 = repo.start_transaction("test"); let main_branch_local_tx1 = testutils::create_random_commit(&settings, &repo).write_to_repo(tx1.mut_repo()); - let main_branch_origin_tx1 = - testutils::create_random_commit(&settings, &repo).write_to_repo(tx1.mut_repo()); tx1.mut_repo().set_local_branch( "main".to_string(), RefTarget::Normal(main_branch_local_tx1.id().clone()),