tests: refactor a few tests to use "test_commit --append"

Refactor a few more tests to use the new "--append" option to "test_commit". I added it for use in the mailmap tests, but this demonstrates how useful it is in general. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Jan 12, 2021 at 21:18 UTC f5d79bf7dd6996b96009ac63b350aa047f2d9959
3 files changed +8 -29
t/t1412-reflog-loop.sh
+2 -5
@@ -4,11 +4,8 @@ test_description='reflog walk shows repeated commits again'
4 . ./test-lib.sh
5
6 test_expect_success 'setup commits' '
7 - test_tick &&
8 - echo content >file && git add file && git commit -m one &&
9 - git tag one &&
10 - echo content >>file && git add file && git commit -m two &&
11 - git tag two
7 + test_commit one file content &&
8 + test_commit --append two file content
9 '
10
11 test_expect_success 'setup reflog with alternating commits' '
t/t2012-checkout-last.sh
+3 -9
@@ -5,13 +5,9 @@ test_description='checkout can switch to last branch and merge base'
5 . ./test-lib.sh
6
7 test_expect_success 'setup' '
8 - echo hello >world &&
9 - git add world &&
10 - git commit -m initial &&
8 + test_commit initial world hello &&
9 git branch other &&
12 - echo "hello again" >>world &&
13 - git add world &&
14 - git commit -m second
10 + test_commit --append second world "hello again"
11 '
12
13 test_expect_success '"checkout -" does not work initially' '
@@ -93,9 +89,7 @@ test_expect_success 'switch to twelfth from the last' '
89
90 test_expect_success 'merge base test setup' '
91 git checkout -b another other &&
96 - echo "hello again" >>world &&
97 - git add world &&
98 - git commit -m third
92 + test_commit --append third world "hello again"
93 '
94
95 test_expect_success 'another...master' '
t/t7810-grep.sh
+3 -15
@@ -687,21 +687,9 @@ test_expect_success 'grep -C1 hunk mark between files' '
687 '
688
689 test_expect_success 'log grep setup' '
690 - echo a >>file &&
691 - test_tick &&
692 - GIT_AUTHOR_NAME="With * Asterisk" \
693 - GIT_AUTHOR_EMAIL="xyzzy@frotz.com" \
694 - git commit -a -m "second" &&
695 -
696 - echo a >>file &&
697 - test_tick &&
698 - git commit -a -m "third" &&
699 -
700 - echo a >>file &&
701 - test_tick &&
702 - GIT_AUTHOR_NAME="Night Fall" \
703 - GIT_AUTHOR_EMAIL="nitfol@frobozz.com" \
704 - git commit -a -m "fourth"
690 + test_commit --append --author "With * Asterisk <xyzzy@frotz.com>" second file a &&
691 + test_commit --append third file a &&
692 + test_commit --append --author "Night Fall <nitfol@frobozz.com>" fourth file a
693 '
694
695 test_expect_success 'log grep (1)' '