Merge branch 'master' of git://repo.or.cz/alt-git
[4msysgit-hv.git] / t / t4109-apply-multifrag.sh
blob97ee1cda57b91a523876d22f9db4d0d395cdcbd7
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
4 # Copyright (c) 2005 Robert Fitzsimons
7 test_description='git apply test patches with multiple fragments.
10 . ./test-lib.sh
12 cmp () {
13 diff -w "$@"
16 cp ../t4109/patch1.patch .
17 cp ../t4109/patch2.patch .
18 cp ../t4109/patch3.patch .
19 cp ../t4109/patch4.patch .
21 test_expect_success "S = git apply (1)" \
22 'git apply patch1.patch patch2.patch'
23 mv main.c main.c.git
25 test_expect_success "S = patch (1)" \
26 'cat patch1.patch patch2.patch | patch -p1'
28 test_expect_success "S = cmp (1)" \
29 'cmp main.c.git main.c'
31 rm -f main.c main.c.git
33 test_expect_success "S = git apply (2)" \
34 'git apply patch1.patch patch2.patch patch3.patch'
35 mv main.c main.c.git
37 test_expect_success "S = patch (2)" \
38 'cat patch1.patch patch2.patch patch3.patch | patch -p1'
40 test_expect_success "S = cmp (2)" \
41 'cmp main.c.git main.c'
43 rm -f main.c main.c.git
45 test_expect_success "S = git apply (3)" \
46 'git apply patch1.patch patch4.patch'
47 mv main.c main.c.git
49 test_expect_success "S = patch (3)" \
50 'cat patch1.patch patch4.patch | patch -p1'
52 test_expect_success "S = cmp (3)" \
53 'cmp main.c.git main.c'
55 test_done