git(7): put the synopsis in a verse style paragraph
[git.git] / t / t4116-apply-reverse.sh
blob69aebe600573fa0e014e97001f40836d3a18b82b
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git-apply in reverse
10 . ./test-lib.sh
12 test_expect_success setup '
14 for i in a b c d e f g h i j k l m n; do echo $i; done >file1 &&
15 tr "[ijk]" '\''[\0\1\2]'\'' <file1 >file2 &&
17 git add file1 file2 &&
18 git commit -m initial &&
19 git tag initial &&
21 for i in a b c g h i J K L m o n p q; do echo $i; done >file1 &&
22 tr "[mon]" '\''[\0\1\2]'\'' <file1 >file2 &&
24 git commit -a -m second &&
26 git diff --binary -R initial >patch
30 test_expect_success 'apply in forward' '
32 git apply --index --binary patch &&
33 git diff initial >diff &&
34 diff -u /dev/null diff
38 test_expect_success 'apply in reverse' '
40 git apply --reverse --binary --index patch &&
41 git diff >diff &&
42 diff -u /dev/null diff
46 test_done