gitweb: Add git_merge sub
[git/gsoc2010-gitweb.git] / t / t3307-notes-man.sh
blob3269f2eebdbb71acd7c88edee2b6efe809637ade
1 #!/bin/sh
3 test_description='Examples from the git-notes man page
5 Make sure the manual is not full of lies.'
7 . ./test-lib.sh
9 test_expect_success 'setup' '
10 test_commit A &&
11 test_commit B &&
12 test_commit C
15 test_expect_success 'example 1: notes to add an Acked-by line' '
16 cat <<-\EOF >expect &&
19 Notes:
20 Acked-by: A C Ker <acker@example.com>
21 EOF
22 git notes add -m "Acked-by: A C Ker <acker@example.com>" B &&
23 git show -s B^{commit} >log &&
24 tail -n 4 log >actual &&
25 test_cmp expect actual
28 test_expect_success 'example 2: binary notes' '
29 cp "$TEST_DIRECTORY"/test4012.png .
30 git checkout B &&
31 blob=$(git hash-object -w test4012.png) &&
32 git notes --ref=logo add -C "$blob" &&
33 git notes --ref=logo copy B C &&
34 git notes --ref=logo show C >actual &&
35 test_cmp test4012.png actual
38 test_done