rebase: use test_commit helper in setup

To prepare for the next commit that will test rebase with oids instead of branch names, update the rebase setup test to add a couple of tags we can use. This uses the test_commit helper so we can replace some lines that add a commit manually. Setting logAllRefUpdates is not necessary because it's on by default for repositories with a working tree. Helped-by: Phillip Wood <phillip.wood123@gmail.com> Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

John Cai committed Mar 18, 2022 at 13:54 UTC 77ab58c0919ea9d13251c3a1ba52b301d91e1912
1 file changed +2 -7
t/t3400-rebase.sh
+2 -7
@@ -18,10 +18,7 @@ GIT_AUTHOR_EMAIL=bogus@email@address
18 export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
19
20 test_expect_success 'prepare repository with topic branches' '
21 - git config core.logAllRefUpdates true &&
22 - echo First >A &&
23 - git update-index --add A &&
24 - git commit -m "Add A." &&
21 + test_commit "Add A." A First First &&
22 git checkout -b force-3way &&
23 echo Dummy >Y &&
24 git update-index --add Y &&
@@ -32,9 +29,7 @@ test_expect_success 'prepare repository with topic branches' '
29 git mv A D/A &&
30 git commit -m "Move A." &&
31 git checkout -b my-topic-branch main &&
35 - echo Second >B &&
36 - git update-index --add B &&
37 - git commit -m "Add B." &&
32 + test_commit "Add B." B Second Second &&
33 git checkout -f main &&
34 echo Third >>A &&
35 git update-index A &&