diff --git a/git-submodule.sh b/git-submodule.sh
index cfd5aa60491a88534aeacb7fe70141aa391675a9..87c9452c8a8ae179ffb7e7958ba95688e95bd0e9 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
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
then
cmd_foreach "--recursive" "$@"
fi
- ) ||
+ ) <&3 3<&- ||
die "$(eval_gettext "Stopping at '\$path'; script returned non-zero status.")"
fi
done