aboutsummaryrefslogtreecommitdiffstats
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-25 13:22:35 -0700
committerJunio C Hamano <gitster@pobox.com>2018-06-25 13:22:35 -0700
commitea27893a65cc41cad2710466aa6a58866ff22f1e (patch)
tree0fbc3a9a9beaa5083ddf858d4c50da7ed4d56972 /git-submodule.sh
parent0bf8c8ce40c32c93e97d6c01a45ecce4d94db2ab (diff)
parentfc1b9243cd5d51ae455272f1f953d4002294edee (diff)
downloadgit-ea27893a65cc41cad2710466aa6a58866ff22f1e.tar.gz
Merge branch 'pc/submodule-helper-foreach'
The bulk of "git submodule foreach" has been rewritten in C. * pc/submodule-helper-foreach: submodule: port submodule subcommand 'foreach' from shell to C submodule foreach: document variable '$displaypath' submodule foreach: document '$sm_path' instead of '$path' submodule foreach: correct '$path' in nested submodules from a subdirectory
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh40
1 files changed, 1 insertions, 39 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 78073cd87d..5f9d9f6ea3 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -335,45 +335,7 @@ cmd_foreach()
shift
done
- 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
-
- {
- git submodule--helper list --prefix "$wt_prefix" ||
- echo "#unmatched" $?
- } |
- while read -r mode sha1 stage sm_path
- do
- die_if_unmatched "$mode" "$sha1"
- if test -e "$sm_path"/.git
- then
- displaypath=$(git submodule--helper relative-path "$prefix$sm_path" "$wt_prefix")
- say "$(eval_gettext "Entering '\$displaypath'")"
- name=$(git submodule--helper name "$sm_path")
- (
- prefix="$prefix$sm_path/"
- sanitize_submodule_env
- cd "$sm_path" &&
- sm_path=$(git submodule--helper relative-path "$sm_path" "$wt_prefix") &&
- # we make $path available to scripts ...
- path=$sm_path &&
- if test $# -eq 1
- then
- eval "$1"
- else
- "$@"
- fi &&
- if test -n "$recursive"
- then
- cmd_foreach "--recursive" "$@"
- fi
- ) <&3 3<&- ||
- die "$(eval_gettext "Stopping at '\$displaypath'; script returned non-zero status.")"
- fi
- done
+ git ${wt_prefix:+-C "$wt_prefix"} ${prefix:+--super-prefix "$prefix"} submodule--helper foreach ${GIT_QUIET:+--quiet} ${recursive:+--recursive} "$@"
}
#