Junio C Hamano | fae22ac | 2005-06-22 02:30:47 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2005 Junio C Hamano |
| 4 | # |
| 5 | |
Johannes Schindelin | c14b9d1 | 2008-06-27 18:43:09 +0100 | [diff] [blame] | 6 | test_description='git apply --stat --summary test, with --recount |
Junio C Hamano | fae22ac | 2005-06-22 02:30:47 -0700 | [diff] [blame] | 7 | |
| 8 | ' |
| 9 | . ./test-lib.sh |
| 10 | |
Johannes Schindelin | c14b9d1 | 2008-06-27 18:43:09 +0100 | [diff] [blame] | 11 | UNC='s/^\(@@ -[1-9][0-9]*\),[0-9]* \(+[1-9][0-9]*\),[0-9]* @@/\1,999 \2,999 @@/' |
Junio C Hamano | fae22ac | 2005-06-22 02:30:47 -0700 | [diff] [blame] | 12 | |
Johannes Schindelin | c14b9d1 | 2008-06-27 18:43:09 +0100 | [diff] [blame] | 13 | num=0 |
| 14 | while read title |
| 15 | do |
| 16 | num=$(( $num + 1 )) |
| 17 | test_expect_success "$title" ' |
| 18 | git apply --stat --summary \ |
| 19 | <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" >current && |
Junio C Hamano | bfdbee9 | 2008-08-08 02:26:28 -0700 | [diff] [blame] | 20 | test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current |
Johannes Schindelin | c14b9d1 | 2008-06-27 18:43:09 +0100 | [diff] [blame] | 21 | ' |
Junio C Hamano | fae22ac | 2005-06-22 02:30:47 -0700 | [diff] [blame] | 22 | |
Johannes Schindelin | c14b9d1 | 2008-06-27 18:43:09 +0100 | [diff] [blame] | 23 | test_expect_success "$title with recount" ' |
| 24 | sed -e "$UNC" <"$TEST_DIRECTORY/t4100/t-apply-$num.patch" | |
| 25 | git apply --recount --stat --summary >current && |
Junio C Hamano | bfdbee9 | 2008-08-08 02:26:28 -0700 | [diff] [blame] | 26 | test_cmp "$TEST_DIRECTORY"/t4100/t-apply-$num.expect current |
Johannes Schindelin | c14b9d1 | 2008-06-27 18:43:09 +0100 | [diff] [blame] | 27 | ' |
| 28 | done <<\EOF |
| 29 | rename |
| 30 | copy |
| 31 | rewrite |
| 32 | mode |
| 33 | non git (1) |
| 34 | non git (2) |
| 35 | non git (3) |
Thomas Rast | 6cf9149 | 2008-07-04 21:10:14 +0200 | [diff] [blame] | 36 | incomplete (1) |
| 37 | incomplete (2) |
Johannes Schindelin | c14b9d1 | 2008-06-27 18:43:09 +0100 | [diff] [blame] | 38 | EOF |
Junio C Hamano | fae22ac | 2005-06-22 02:30:47 -0700 | [diff] [blame] | 39 | |
| 40 | test_done |