diff mbox series

t3705-add-sparse-checkout: ignore a LF->CRLF warning on Windows

Message ID df42170b-8659-d496-3454-a4a3ac2827eb@kdbg.org (mailing list archive)
State New, archived
Headers show
Series t3705-add-sparse-checkout: ignore a LF->CRLF warning on Windows | expand

Commit Message

Johannes Sixt Jan. 15, 2022, 2:58 p.m. UTC
There are checks that certain `git add` invocations do not produce
output on stderr. One of them, the original one, uses
"-c core.autocrlf=input" to ensure that `git add` does not write a
hint about LF to CRLF conversion to stderr on Windows. A second
`git add` was added in later patch, but it was forgotten to add
the same protection. Add it now to let the test pass on Windows.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Am 13.01.22 um 22:12 schrieb Johannes Sixt:
> is there a reason we don't do this in the test case that you added in
> 63b60b3add75 ("add: update --chmod to skip sparse paths", 2021-09-24).
> Notice that the similar git add earlier also sets core.autocrlf.

Here's a proper patch.

 t/t3705-add-sparse-checkout.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Derrick Stolee Jan. 18, 2022, 4:17 p.m. UTC | #1
On 1/15/2022 9:58 AM, Johannes Sixt wrote:
> There are checks that certain `git add` invocations do not produce
> output on stderr. One of them, the original one, uses
> "-c core.autocrlf=input" to ensure that `git add` does not write a
> hint about LF to CRLF conversion to stderr on Windows. A second
> `git add` was added in later patch, but it was forgotten to add
> the same protection. Add it now to let the test pass on Windows.
> 
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
> Am 13.01.22 um 22:12 schrieb Johannes Sixt:
>> is there a reason we don't do this in the test case that you added in
>> 63b60b3add75 ("add: update --chmod to skip sparse paths", 2021-09-24).
>> Notice that the similar git add earlier also sets core.autocrlf.
> 
> Here's a proper patch.

Thanks for this fix. I'm not sure why this fails on your Windows
machine but passes the Windows CI builds. Glad to have the fix
either way.
> -	git add --sparse --chmod=+x sparse_entry 2>stderr &&
> +	git -c core.autocrlf=input add --sparse --chmod=+x sparse_entry 2>stderr &&

Thanks,
-Stolee
diff mbox series

Patch

diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh
index 81f3384eee..4fb663e3b4 100755
--- a/t/t3705-add-sparse-checkout.sh
+++ b/t/t3705-add-sparse-checkout.sh
@@ -184,7 +184,7 @@  test_expect_success 'git add fails outside of sparse-checkout definition' '
 	git ls-files --stage >actual &&
 	grep "^100644 .*sparse_entry\$" actual &&
 
-	git add --sparse --chmod=+x sparse_entry 2>stderr &&
+	git -c core.autocrlf=input add --sparse --chmod=+x sparse_entry 2>stderr &&
 	test_must_be_empty stderr &&
 	git ls-files --stage >actual &&
 	grep "^100755 .*sparse_entry\$" actual &&