Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-07-14 01:31:37 +0400
committerJunio C Hamano <gitster@pobox.com>2011-07-14 01:31:37 +0400
commit13ac90a47878b0bb26375a1a6901a629aa2b2def (patch)
tree3e0635c48258bd5ac61fa796be7c8e427457bb4c /git-submodule.sh
parent0e8a23bf1f75fbae5ffff2e3847adb4543d3ae0b (diff)
parent4dca1aa6502a46f8d7b6ecc8e7812c5c23ad0923 (diff)
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-xgit-submodule.sh6
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