| 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='git apply --numstat - <patch' |
| 4 | |
| 5 | |
| 6 | . ./test-lib.sh |
| 7 | |
| 8 | test_expect_success setup ' |
| 9 | echo hello >text && |
| 10 | git add text && |
| 11 | echo goodbye >text && |
| 12 | git diff >patch |
| 13 | ' |
| 14 | |
| 15 | test_expect_success 'git apply --numstat - < patch' ' |
| 16 | echo "1 1 text" >expect && |
| 17 | git apply --numstat - <patch >actual && |
| 18 | test_cmp expect actual |
| 19 | ' |
| 20 | |
| 21 | test_expect_success 'git apply --numstat - < patch patch' ' |
| 22 | cat >expect <<-\EOF && |
| 23 | 1 1 text |
| 24 | 1 1 text |
| 25 | EOF |
| 26 | git apply --numstat - < patch patch >actual && |
| 27 | test_cmp expect actual |
| 28 | ' |
| 29 | |
| 30 | test_done |