Code

xsize_t: check whether we lose bits
[git.git] / t / t4118-apply-empty-context.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2006 Junio C Hamano
4 #
6 test_description='git-apply with new style GNU diff with empty context
8 '
10 . ./test-lib.sh
12 test_expect_success setup '
13         {
14                 echo; echo;
15                 echo A; echo B; echo C;
16                 echo;
17         } >file1 &&
18         cat file1 >file1.orig &&
19         {
20                 cat file1 &&
21                 echo Q | tr -d "\\012"
22         } >file2 &&
23         cat file2 >file2.orig
24         git add file1 file2 &&
25         sed -e "/^B/d" <file1.orig >file1 &&
26         sed -e "/^B/d" <file2.orig >file2 &&
27         cat file1 >file1.mods &&
28         cat file2 >file2.mods &&
29         git diff |
30         sed -e "s/^ \$//" >diff.output
31 '
33 test_expect_success 'apply --numstat' '
35         git apply --numstat diff.output >actual &&
36         {
37                 echo "0 1       file1" &&
38                 echo "0 1       file2"
39         } >expect &&
40         diff -u expect actual
42 '
44 test_expect_success 'apply --apply' '
46         cat file1.orig >file1 &&
47         cat file2.orig >file2 &&
48         git update-index file1 file2 &&
49         git apply --index diff.output &&
50         diff -u file1.mods file1 &&
51         diff -u file2.mods file2
52 '
54 test_done