aboutsummaryrefslogtreecommitdiffstats
path: root/t/t4006-diff-mode.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-05-10 16:19:06 +0200
committerJunio C Hamano <gitster@pobox.com>2021-05-11 12:45:18 +0900
commit47c88d16ba6c5c0237238ac600ee8b74a522e41c (patch)
treefece7ae67a32ccf52950137bd8b536ce2d0cb1e9 /t/t4006-diff-mode.sh
parent8cfe386b78c15eff38388479aa2f9fae00a9cf53 (diff)
downloadgit-47c88d16ba6c5c0237238ac600ee8b74a522e41c.tar.gz
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>
Diffstat (limited to 't/t4006-diff-mode.sh')
-rwxr-xr-xt/t4006-diff-mode.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh
index 275ce5fa15..6cdee2a216 100755
--- a/t/t4006-diff-mode.sh
+++ b/t/t4006-diff-mode.sh
@@ -26,10 +26,8 @@ test_expect_success 'chmod' '
'
test_expect_success 'prepare binary file' '
- git commit -m rezrov &&
- printf "\00\01\02\03\04\05\06" >binbin &&
- git add binbin &&
- git commit -m binbin
+ git commit -m one &&
+ test_commit --printf two binbin "\00\01\02\03\04\05\06"
'
test_expect_success '--stat output after text chmod' '