X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7407-submodule-foreach.sh;h=be745fb23f3f27ed319143d3d3ab3f26d01857bc;hb=af52e6b06ad108aa372fcc8432f1c449eeb5a34b;hp=ae3bd18a5ed167caa461f269cd77b6f34a6ae7b0;hpb=551d75dbd80cb6af08376ea8a12bdaa3f5860f35;p=git.git diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh index ae3bd18a5..be745fb23 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