summaryrefslogtreecommitdiff
path: root/t/t7407-submodule-foreach.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-08-16 11:23:26 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-08-16 11:23:26 -0700
commitd5c756e99ed7aa07427295b1011edf4718ea80b0 (patch)
tree5891cf85b913b5f363cfce727cef7f99a972b488 /t/t7407-submodule-foreach.sh
parentMerge branch 'aw/rebase-i-p' into maint (diff)
parentgit-submodule.sh: preserve stdin for the command spawned by foreach (diff)
downloadtgif-d5c756e99ed7aa07427295b1011edf4718ea80b0.tar.xz
Merge branch 'bc/submodule-foreach-stdin-fix-1.7.4' into maint
* 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
Diffstat (limited to 't/t7407-submodule-foreach.sh')
-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 e5be13c271..835a506241 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