diff options
author | Charvi Mendiratta <charvi077@gmail.com> | 2021-02-10 17:06:46 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-10 13:58:19 -0800 |
commit | 733ad2e15a5f078543fb0a5a10ee8ae5419d318e (patch) | |
tree | f6932e4a747eeffe1b1a12ed5507e7237bcad96c /t/t3437-rebase-fixup-options.sh | |
parent | t/t3437: fixup here-docs in the 'setup' test (diff) | |
download | tgif-733ad2e15a5f078543fb0a5a10ee8ae5419d318e.tar.xz |
t/t3437: remove the dependency of 'expected-message' file from tests
As it is currently implemented, it's too difficult to follow along and
remember the value of "expected-message" from test to test. It also
makes it difficult to extend tests or add new tests in between existing
tests without negatively impacting other tests.
Let's set up "expected-message" to the precise content needed by the
test, so that both the problems go away and also makes easier to run
tests selectively with '--run' or 'GIT_SKIP_TESTS'
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Charvi Mendiratta <charvi077@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3437-rebase-fixup-options.sh')
-rwxr-xr-x | t/t3437-rebase-fixup-options.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t3437-rebase-fixup-options.sh b/t/t3437-rebase-fixup-options.sh index f599da3e08..d368ab4d4b 100755 --- a/t/t3437-rebase-fixup-options.sh +++ b/t/t3437-rebase-fixup-options.sh @@ -46,8 +46,6 @@ test_expect_success 'setup' ' body EOF - sed "1,2d" message >expected-message && - test_commit A A && test_commit B B && get_author HEAD >expected-author && @@ -134,6 +132,7 @@ test_expect_success 'simple fixup -c works' ' test_expect_success 'fixup -C removes amend! from message' ' test_when_finished "test_might_fail git rebase --abort" && git checkout --detach A1 && + git log -1 --pretty=format:%b >expected-message && FAKE_LINES="1 fixup_-C 2" git rebase -i A && test_cmp_rev HEAD^ A && test_cmp_rev HEAD^{tree} A1^{tree} && @@ -145,13 +144,14 @@ test_expect_success 'fixup -C removes amend! from message' ' test_expect_success 'fixup -C with conflicts gives correct message' ' test_when_finished "test_might_fail git rebase --abort" && git checkout --detach A1 && + git log -1 --pretty=format:%b >expected-message && + test_write_lines "" "edited" >>expected-message && test_must_fail env FAKE_LINES="1 fixup_-C 2" git rebase -i conflicts && git checkout --theirs -- A && git add A && FAKE_COMMIT_AMEND=edited git rebase --continue && test_cmp_rev HEAD^ conflicts && test_cmp_rev HEAD^{tree} A1^{tree} && - test_write_lines "" edited >>expected-message && test_commit_message HEAD expected-message && get_author HEAD >actual-author && test_cmp expected-author actual-author |