diff options
| author | Junio C Hamano <gitster@pobox.com> | 2011-07-13 14:31:37 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2011-07-13 14:31:37 -0700 |
| commit | 13ac90a47878b0bb26375a1a6901a629aa2b2def (patch) | |
| tree | 3e0635c48258bd5ac61fa796be7c8e427457bb4c /git-submodule.sh | |
| parent | Merge branch 'nk/ref-doc' (diff) | |
| parent | git-submodule.sh: preserve stdin for the command spawned by foreach (diff) | |
| download | git-13ac90a47878b0bb26375a1a6901a629aa2b2def.tar.gz git-13ac90a47878b0bb26375a1a6901a629aa2b2def.zip | |
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 'git-submodule.sh')
| -rwxr-xr-x | git-submodule.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index cfd5aa6049..87c9452c8a 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -304,6 +304,10 @@ cmd_foreach() toplevel=$(pwd) + # dup stdin so that it can be restored when running the external + # command in the subshell (and a recursive call to this function) + exec 3<&0 + module_list | while read mode sha1 stage path do @@ -320,7 +324,7 @@ cmd_foreach() then cmd_foreach "--recursive" "$@" fi - ) || + ) <&3 3<&- || die "$(eval_gettext "Stopping at '\$path'; script returned non-zero status.")" fi done |
