]>
Commit | Line | Data |
---|---|---|
c4730f35 JS |
1 | #!/bin/sh |
2 | ||
3 | test_description='apply same filename' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7 | test_expect_success 'setup' ' | |
8 | ||
9 | mkdir -p some/sub/dir && | |
10 | echo Hello > some/sub/dir/file && | |
8ee4a6c2 JH |
11 | git add some/sub/dir/file && |
12 | git commit -m initial && | |
13 | git tag initial | |
c4730f35 JS |
14 | |
15 | ' | |
16 | ||
17 | cat > patch << EOF | |
18 | diff a/bla/blub/dir/file b/bla/blub/dir/file | |
19 | --- a/bla/blub/dir/file | |
20 | +++ b/bla/blub/dir/file | |
21 | @@ -1,1 +1,1 @@ | |
22 | -Hello | |
23 | +Bello | |
24 | EOF | |
25 | ||
f5563887 | 26 | test_expect_success 'apply --directory -p (1)' ' |
c4730f35 | 27 | |
f5563887 | 28 | git apply --directory=some/sub -p3 --index patch && |
c4730f35 JS |
29 | test Bello = $(git show :some/sub/dir/file) && |
30 | test Bello = $(cat some/sub/dir/file) | |
31 | ||
32 | ' | |
33 | ||
f5563887 | 34 | test_expect_success 'apply --directory -p (2) ' ' |
8ee4a6c2 JH |
35 | |
36 | git reset --hard initial && | |
f5563887 | 37 | git apply --directory=some/sub/ -p3 --index patch && |
8ee4a6c2 JH |
38 | test Bello = $(git show :some/sub/dir/file) && |
39 | test Bello = $(cat some/sub/dir/file) | |
40 | ||
41 | ' | |
42 | ||
c4730f35 | 43 | test_done |