summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2009-08-16 01:10:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-08-18 19:27:57 (GMT)
commit1e7f2aad7dd9b0b5ec8bbae2e3015915687e2cd2 (patch)
treed6cc7241629d08aa5efbd5c4b67e61b0ea9f80a4 /git-submodule.sh
parent64d5fe0a23e3a16179c7c185662f25d85fe631dd (diff)
downloadgit-1e7f2aad7dd9b0b5ec8bbae2e3015915687e2cd2.zip
git-1e7f2aad7dd9b0b5ec8bbae2e3015915687e2cd2.tar.gz
git-1e7f2aad7dd9b0b5ec8bbae2e3015915687e2cd2.tar.bz2
git submodule foreach: Provide access to submodule name, as '$name'
The argument to 'git submodule foreach' already has access to the variables '$path' (the path to the submodule, relative to the superproject) and '$sha1' (the submodule commit recorded by the superproject). This patch adds another variable -- '$name' -- which contains the name of the submodule, as recorded in the superproject's .gitmodules file. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index ebed711..d8ecdb9 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -243,6 +243,7 @@ cmd_foreach()
if test -e "$path"/.git
then
say "Entering '$path'"
+ name=$(module_name "$path")
(cd "$path" && eval "$@") ||
die "Stopping at '$path'; script returned non-zero status."
fi