-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resurrect "git apply --flags -" to read from the standard input
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>
- Loading branch information
Junio C Hamano
committed
Jan 10, 2009
1 parent
f26c494
commit 64912a6
Showing
2 changed files
with
31 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/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 |