]> git.ipfire.org Git - thirdparty/git.git/commit
test-lib functions: add --printf option to test_commit
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 10 May 2021 14:19:06 +0000 (16:19 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 May 2021 03:45:18 +0000 (12:45 +0900)
commit47c88d16ba6c5c0237238ac600ee8b74a522e41c
treefece7ae67a32ccf52950137bd8b536ce2d0cb1e9
parent8cfe386b78c15eff38388479aa2f9fae00a9cf53
test-lib functions: add --printf option to test_commit

Add a --printf option to test_commit to allow writing to the file with
"printf" instead of "echo".

This is useful for writing "\n", "\0" etc., in particular in
combination with the --append option added in 3373518cc8 (test-lib
functions: add an --append option to test_commit, 2021-01-12).

I'm converting a few tests to use the new option rather than a manual
printf/add/commit combination to demonstrate its usefulness. While I'm
at it use "test_create_repo" where appropriate, and give the
first/second commit a meaningful/more conventional log message in
cases where no test cared about that message.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1307-config-blob.sh
t/t2030-unresolve-info.sh
t/t4006-diff-mode.sh
t/t4030-diff-textconv.sh
t/t5520-pull.sh
t/test-lib-functions.sh