mirror of
https://github.com/git/git.git
synced 2024-12-12 11:24:02 +08:00
b5967f820c
The test4012.png test vector file that was originally used for t4012 to check operations on binary files was later reused in other tests, making it no longer consistent to name it after a specific test. Rename it to more generic "test-binary-1.png". While at it, rename test9200b to "test-binary-2.png" (even though it is only used by t9200). Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
39 lines
836 B
Bash
Executable File
39 lines
836 B
Bash
Executable File
#!/bin/sh
|
|
|
|
test_description='Examples from the git-notes man page
|
|
|
|
Make sure the manual is not full of lies.'
|
|
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success 'setup' '
|
|
test_commit A &&
|
|
test_commit B &&
|
|
test_commit C
|
|
'
|
|
|
|
test_expect_success 'example 1: notes to add an Acked-by line' '
|
|
cat <<-\EOF >expect &&
|
|
B
|
|
|
|
Notes:
|
|
Acked-by: A C Ker <acker@example.com>
|
|
EOF
|
|
git notes add -m "Acked-by: A C Ker <acker@example.com>" B &&
|
|
git show -s B^{commit} >log &&
|
|
tail -n 4 log >actual &&
|
|
test_cmp expect actual
|
|
'
|
|
|
|
test_expect_success 'example 2: binary notes' '
|
|
cp "$TEST_DIRECTORY"/test-binary-1.png . &&
|
|
git checkout B &&
|
|
blob=$(git hash-object -w test-binary-1.png) &&
|
|
git notes --ref=logo add -C "$blob" &&
|
|
git notes --ref=logo copy B C &&
|
|
git notes --ref=logo show C >actual &&
|
|
test_cmp test-binary-1.png actual
|
|
'
|
|
|
|
test_done
|