mirror of
https://github.com/git/git.git
synced 2024-11-14 13:13:01 +01:00
64912a67a4
The previous "parse-opt"ification broke git-apply reading from the standard input. "git apply A - C <B" is supposed to read patches from files A, B and C in this order. Before "parse-opt"ification, we used be able to: git apply --stat - --apply <A B to read the patch from file A, showing only the diffstat, and then read the patch from file B, showing the diffstat and actually applying it. Even with this fix we cannot do that anymore, but that is so crazy use case I do not think anybody sane relied on such a broken behaviour. Signed-off-by: Junio C Hamano <gitster@pobox.com>
26 lines
532 B
Bash
Executable file
26 lines
532 B
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='git apply --numstat - <patch'
|
|
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success setup '
|
|
echo hello >text &&
|
|
git add text &&
|
|
echo goodbye >text &&
|
|
git diff >patch
|
|
'
|
|
|
|
test_expect_success 'git apply --numstat - < patch' '
|
|
echo "1 1 text" >expect &&
|
|
git apply --numstat - <patch >actual &&
|
|
test_cmp expect actual
|
|
'
|
|
|
|
test_expect_success 'git apply --numstat - < patch patch' '
|
|
for i in 1 2; do echo "1 1 text"; done >expect &&
|
|
git apply --numstat - < patch patch >actual &&
|
|
test_cmp expect actual
|
|
'
|
|
|
|
test_done
|