diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-01-12 23:18:00 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-01-13 01:04:41 +0300 |
commit | f5d79bf7dd6996b96009ac63b350aa047f2d9959 (patch) | |
tree | 90f3d3f39a2e48de0390a6fc8aea45b11c57d13e /t/t2012-checkout-last.sh | |
parent | 3373518cc8bd0916581ccfd4a2ee9682d61a8874 (diff) |
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>
Diffstat (limited to 't/t2012-checkout-last.sh')
-rwxr-xr-x | t/t2012-checkout-last.sh | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh index e7ba8c505f..c95aa3e78f 100755 --- a/t/t2012-checkout-last.sh +++ b/t/t2012-checkout-last.sh @@ -5,13 +5,9 @@ test_description='checkout can switch to last branch and merge base' . ./test-lib.sh test_expect_success 'setup' ' - echo hello >world && - git add world && - git commit -m initial && + test_commit initial world hello && git branch other && - echo "hello again" >>world && - git add world && - git commit -m second + test_commit --append second world "hello again" ' test_expect_success '"checkout -" does not work initially' ' @@ -93,9 +89,7 @@ test_expect_success 'switch to twelfth from the last' ' test_expect_success 'merge base test setup' ' git checkout -b another other && - echo "hello again" >>world && - git add world && - git commit -m third + test_commit --append third world "hello again" ' test_expect_success 'another...master' ' |