|
4 | 4 | # Copyright (c) 2005 Robert Fitzsimons |
5 | 5 | # |
6 | 6 |
|
7 | | -test_description='git apply test patches with multiple fragments. |
| 7 | +test_description='git apply test patches with multiple fragments.' |
8 | 8 |
|
9 | | -' |
10 | 9 | . ./test-lib.sh |
11 | 10 |
|
12 | | -cp ../t4109/patch1.patch . |
13 | | -cp ../t4109/patch2.patch . |
14 | | -cp ../t4109/patch3.patch . |
15 | | -cp ../t4109/patch4.patch . |
16 | | - |
17 | | -test_expect_success "S = git apply (1)" \ |
18 | | - 'git apply patch1.patch patch2.patch' |
19 | | -mv main.c main.c.git |
20 | | - |
21 | | -test_expect_success "S = patch (1)" \ |
22 | | - 'cat patch1.patch patch2.patch | patch -p1' |
23 | | - |
24 | | -test_expect_success "S = cmp (1)" \ |
25 | | - 'cmp main.c.git main.c' |
26 | | - |
27 | | -rm -f main.c main.c.git |
28 | | - |
29 | | -test_expect_success "S = git apply (2)" \ |
30 | | - 'git apply patch1.patch patch2.patch patch3.patch' |
31 | | -mv main.c main.c.git |
32 | | - |
33 | | -test_expect_success "S = patch (2)" \ |
34 | | - 'cat patch1.patch patch2.patch patch3.patch | patch -p1' |
| 11 | +cp "$TEST_DIRECTORY/t4109/patch1.patch" . |
| 12 | +cp "$TEST_DIRECTORY/t4109/patch2.patch" . |
| 13 | +cp "$TEST_DIRECTORY/t4109/patch3.patch" . |
| 14 | +cp "$TEST_DIRECTORY/t4109/patch4.patch" . |
35 | 15 |
|
36 | | -test_expect_success "S = cmp (2)" \ |
37 | | - 'cmp main.c.git main.c' |
| 16 | +test_expect_success 'git apply (1)' ' |
| 17 | + git apply patch1.patch patch2.patch && |
| 18 | + test_cmp "$TEST_DIRECTORY/t4109/expect-1" main.c |
| 19 | +' |
| 20 | +rm -f main.c |
38 | 21 |
|
39 | | -rm -f main.c main.c.git |
| 22 | +test_expect_success 'git apply (2)' ' |
| 23 | + git apply patch1.patch patch2.patch patch3.patch && |
| 24 | + test_cmp "$TEST_DIRECTORY/t4109/expect-2" main.c |
| 25 | +' |
| 26 | +rm -f main.c |
40 | 27 |
|
41 | | -test_expect_success "S = git apply (3)" \ |
42 | | - 'git apply patch1.patch patch4.patch' |
| 28 | +test_expect_success 'git apply (3)' ' |
| 29 | + git apply patch1.patch patch4.patch && |
| 30 | + test_cmp "$TEST_DIRECTORY/t4109/expect-3" main.c |
| 31 | +' |
43 | 32 | mv main.c main.c.git |
44 | 33 |
|
45 | | -test_expect_success "S = patch (3)" \ |
46 | | - 'cat patch1.patch patch4.patch | patch -p1' |
47 | | - |
48 | | -test_expect_success "S = cmp (3)" \ |
49 | | - 'cmp main.c.git main.c' |
50 | | - |
51 | 34 | test_done |
52 | 35 |
|
0 commit comments