summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-07-13 21:31:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-07-13 21:31:37 (GMT)
commit13ac90a47878b0bb26375a1a6901a629aa2b2def (patch)
tree3e0635c48258bd5ac61fa796be7c8e427457bb4c /t
parent0e8a23bf1f75fbae5ffff2e3847adb4543d3ae0b (diff)
parent4dca1aa6502a46f8d7b6ecc8e7812c5c23ad0923 (diff)
downloadgit-13ac90a47878b0bb26375a1a6901a629aa2b2def.zip
git-13ac90a47878b0bb26375a1a6901a629aa2b2def.tar.gz
git-13ac90a47878b0bb26375a1a6901a629aa2b2def.tar.bz2
Merge branch 'bc/submodule-foreach-stdin-fix-1.7.4'
* bc/submodule-foreach-stdin-fix-1.7.4: git-submodule.sh: preserve stdin for the command spawned by foreach t/t7407: demonstrate that the command called by 'submodule foreach' loses stdin Conflicts: git-submodule.sh
Diffstat (limited to 't')
-rwxr-xr-xt/t7407-submodule-foreach.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index ae3bd18..be745fb 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -292,4 +292,22 @@ test_expect_success 'use "update --recursive nested1" to checkout all submodules
)
'
+test_expect_success 'command passed to foreach retains notion of stdin' '
+ (
+ cd super &&
+ git submodule foreach echo success >../expected &&
+ yes | git submodule foreach "read y && test \"x\$y\" = xy && echo success" >../actual
+ ) &&
+ test_cmp expected actual
+'
+
+test_expect_success 'command passed to foreach --recursive retains notion of stdin' '
+ (
+ cd clone2 &&
+ git submodule foreach --recursive echo success >../expected &&
+ yes | git submodule foreach --recursive "read y && test \"x\$y\" = xy && echo success" >../actual
+ ) &&
+ test_cmp expected actual
+'
+
test_done