t7401: change indentation for enhanced readability

Change the indentation of expected outputs for enhanced readability of
the tests. Also modify the heredoc string limiter in a test which lacks
it to support the indentation change.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Taylor Blau <me@taylorr.com>
Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Shourya Shukla
2020-08-21 22:29:51 +05:30
committed by Junio C Hamano
parent 17c102e30d
commit 3a4fdeee89

View File

@ -38,10 +38,10 @@ test_expect_success 'added submodule' "
git add sm1 && git add sm1 &&
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 0000000...$head1 (2): * sm1 0000000...$head1 (2):
> Add foo2 > Add foo2
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
@ -52,10 +52,10 @@ test_expect_success 'added submodule (subdirectory)' "
git submodule summary >../actual git submodule summary >../actual
) && ) &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* ../sm1 0000000...$head1 (2): * ../sm1 0000000...$head1 (2):
> Add foo2 > Add foo2
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
@ -73,10 +73,10 @@ test_expect_success 'added submodule (subdirectory with explicit path)' "
git submodule summary ../sm1 >../actual git submodule summary ../sm1 >../actual
) && ) &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* ../sm1 0000000...$head1 (2): * ../sm1 0000000...$head1 (2):
> Add foo2 > Add foo2
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
@ -86,20 +86,20 @@ head2=$(add_file sm1 foo3)
test_expect_success 'modified submodule(forward)' " test_expect_success 'modified submodule(forward)' "
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head1...$head2 (1): * sm1 $head1...$head2 (1):
> Add foo3 > Add foo3
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
test_expect_success 'modified submodule(forward), --files' " test_expect_success 'modified submodule(forward), --files' "
git submodule summary --files >actual && git submodule summary --files >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head1...$head2 (1): * sm1 $head1...$head2 (1):
> Add foo3 > Add foo3
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
@ -110,10 +110,10 @@ test_expect_success 'no ignore=all setting has any effect' "
git config diff.ignoreSubmodules all && git config diff.ignoreSubmodules all &&
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head1...$head2 (1): * sm1 $head1...$head2 (1):
> Add foo3 > Add foo3
EOF EOF
test_cmp expected actual && test_cmp expected actual &&
git config --unset diff.ignoreSubmodules && git config --unset diff.ignoreSubmodules &&
git config --remove-section submodule.sm1 && git config --remove-section submodule.sm1 &&
@ -131,11 +131,11 @@ head3=$(
test_expect_success 'modified submodule(backward)' " test_expect_success 'modified submodule(backward)' "
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head2...$head3 (2): * sm1 $head2...$head3 (2):
< Add foo3 < Add foo3
< Add foo2 < Add foo2
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
@ -144,25 +144,25 @@ head4_full=$(GIT_DIR=sm1/.git git rev-parse --verify HEAD)
test_expect_success 'modified submodule(backward and forward)' " test_expect_success 'modified submodule(backward and forward)' "
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head2...$head4 (4): * sm1 $head2...$head4 (4):
> Add foo5 > Add foo5
> Add foo4 > Add foo4
< Add foo3 < Add foo3
< Add foo2 < Add foo2
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
test_expect_success '--summary-limit' " test_expect_success '--summary-limit' "
git submodule summary -n 3 >actual && git submodule summary -n 3 >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head2...$head4 (4): * sm1 $head2...$head4 (4):
> Add foo5 > Add foo5
> Add foo4 > Add foo4
< Add foo3 < Add foo3
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
@ -177,20 +177,20 @@ mv sm1-bak sm1
test_expect_success 'typechanged submodule(submodule->blob), --cached' " test_expect_success 'typechanged submodule(submodule->blob), --cached' "
git submodule summary --cached >actual && git submodule summary --cached >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head4(submodule)->$head5(blob) (3): * sm1 $head4(submodule)->$head5(blob) (3):
< Add foo5 < Add foo5
EOF EOF
test_i18ncmp expected actual test_i18ncmp expected actual
" "
test_expect_success 'typechanged submodule(submodule->blob), --files' " test_expect_success 'typechanged submodule(submodule->blob), --files' "
git submodule summary --files >actual && git submodule summary --files >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head5(blob)->$head4(submodule) (3): * sm1 $head5(blob)->$head4(submodule) (3):
> Add foo5 > Add foo5
EOF EOF
test_i18ncmp expected actual test_i18ncmp expected actual
" "
@ -199,9 +199,9 @@ git checkout-index sm1
test_expect_success 'typechanged submodule(submodule->blob)' " test_expect_success 'typechanged submodule(submodule->blob)' "
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head4(submodule)->$head5(blob): * sm1 $head4(submodule)->$head5(blob):
EOF EOF
test_i18ncmp expected actual test_i18ncmp expected actual
" "
@ -211,10 +211,10 @@ head6=$(add_file sm1 foo6 foo7)
test_expect_success 'nonexistent commit' " test_expect_success 'nonexistent commit' "
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head4...$head6: * sm1 $head4...$head6:
Warn: sm1 doesn't contain commit $head4_full Warn: sm1 doesn't contain commit $head4_full
EOF EOF
test_i18ncmp expected actual test_i18ncmp expected actual
" "
@ -222,10 +222,10 @@ commit_file
test_expect_success 'typechanged submodule(blob->submodule)' " test_expect_success 'typechanged submodule(blob->submodule)' "
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head5(blob)->$head6(submodule) (2): * sm1 $head5(blob)->$head6(submodule) (2):
> Add foo7 > Add foo7
EOF EOF
test_i18ncmp expected actual test_i18ncmp expected actual
" "
@ -234,9 +234,9 @@ rm -rf sm1
test_expect_success 'deleted submodule' " test_expect_success 'deleted submodule' "
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head6...0000000: * sm1 $head6...0000000:
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
@ -249,22 +249,22 @@ test_expect_success 'create second submodule' '
test_expect_success 'multiple submodules' " test_expect_success 'multiple submodules' "
git submodule summary >actual && git submodule summary >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head6...0000000: * sm1 $head6...0000000:
* sm2 0000000...$head7 (2): * sm2 0000000...$head7 (2):
> Add foo9 > Add foo9
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
test_expect_success 'path filter' " test_expect_success 'path filter' "
git submodule summary sm2 >actual && git submodule summary sm2 >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm2 0000000...$head7 (2): * sm2 0000000...$head7 (2):
> Add foo9 > Add foo9
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
@ -272,24 +272,24 @@ commit_file sm2
test_expect_success 'given commit' " test_expect_success 'given commit' "
git submodule summary HEAD^ >actual && git submodule summary HEAD^ >actual &&
cat >expected <<-EOF && cat >expected <<-EOF &&
* sm1 $head6...0000000: * sm1 $head6...0000000:
* sm2 0000000...$head7 (2): * sm2 0000000...$head7 (2):
> Add foo9 > Add foo9
EOF EOF
test_cmp expected actual test_cmp expected actual
" "
test_expect_success '--for-status' " test_expect_success '--for-status' "
git submodule summary --for-status HEAD^ >actual && git submodule summary --for-status HEAD^ >actual &&
test_i18ncmp - actual <<EOF test_i18ncmp - actual <<-EOF
* sm1 $head6...0000000: * sm1 $head6...0000000:
* sm2 0000000...$head7 (2): * sm2 0000000...$head7 (2):
> Add foo9 > Add foo9
EOF EOF
" "
test_expect_success 'fail when using --files together with --cached' " test_expect_success 'fail when using --files together with --cached' "