The 19th batch
[git.git] / t / t4131-apply-fake-ancestor.sh
blob40c92115a66e83593ef4f9dcb879a0eabe1e625a
1 #!/bin/sh
3 # Copyright (c) 2009 Stephen Boyd
6 test_description='git apply --build-fake-ancestor handling.'
8 TEST_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
11 test_expect_success 'setup' '
12 test_commit 1 &&
13 test_commit 2 &&
14 mkdir sub &&
15 test_commit 3 sub/3.t &&
16 test_commit 4
19 test_expect_success 'apply --build-fake-ancestor' '
20 git checkout 2 &&
21 echo "A" > 1.t &&
22 git diff > 1.patch &&
23 git reset --hard &&
24 git checkout 1 &&
25 git apply --build-fake-ancestor 1.ancestor 1.patch
28 test_expect_success 'apply --build-fake-ancestor in a subdirectory' '
29 git checkout 3 &&
30 echo "C" > sub/3.t &&
31 git diff > 3.patch &&
32 git reset --hard &&
33 git checkout 4 &&
35 cd sub &&
36 git apply --build-fake-ancestor 3.ancestor ../3.patch &&
37 test -f 3.ancestor
38 ) &&
39 git apply --build-fake-ancestor 3.ancestor 3.patch &&
40 test_cmp sub/3.ancestor 3.ancestor
43 test_done