Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
submodule: use the 'submodule--helper config' command
author
Antonio Ospite
<ao2@ao2.it>
Fri, 5 Oct 2018 13:05:57 +0000
(15:05 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 9 Oct 2018 03:40:21 +0000
(12:40 +0900)
Use the 'submodule--helper config' command in git-submodules.sh to avoid
referring explicitly to .gitmodules by the hardcoded file path.
This makes it possible to access the submodules configuration in a more
controlled way.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2502ffc
)
diff --git
a/git-submodule.sh
b/git-submodule.sh
index 1cb2c0a31b416f9db979cb86badac5f958792453..25b9bc58cb8e20e5eb55e3e758c28e4e55df17f7 100755
(executable)
--- a/
git-submodule.sh
+++ b/
git-submodule.sh
@@
-72,7
+72,7
@@
get_submodule_config () {
value=$(git config submodule."$name"."$option")
if test -z "$value"
then
value=$(git config submodule."$name"."$option")
if test -z "$value"
then
- value=$(git
config -f .gitmodules
submodule."$name"."$option")
+ value=$(git
submodule--helper config
submodule."$name"."$option")
fi
printf '%s' "${value:-$default}"
}
fi
printf '%s' "${value:-$default}"
}
@@
-283,11
+283,11
@@
or you are unsure what this means choose another name with the '--name' option."
git add --no-warn-embedded-repo $force "$sm_path" ||
die "$(eval_gettext "Failed to add submodule '\$sm_path'")"
git add --no-warn-embedded-repo $force "$sm_path" ||
die "$(eval_gettext "Failed to add submodule '\$sm_path'")"
- git
config -f .gitmodules
submodule."$sm_name".path "$sm_path" &&
- git
config -f .gitmodules
submodule."$sm_name".url "$repo" &&
+ git
submodule--helper config
submodule."$sm_name".path "$sm_path" &&
+ git
submodule--helper config
submodule."$sm_name".url "$repo" &&
if test -n "$branch"
then
if test -n "$branch"
then
- git
config -f .gitmodules
submodule."$sm_name".branch "$branch"
+ git
submodule--helper config
submodule."$sm_name".branch "$branch"
fi &&
git add --force .gitmodules ||
die "$(eval_gettext "Failed to register submodule '\$sm_path'")"
fi &&
git add --force .gitmodules ||
die "$(eval_gettext "Failed to register submodule '\$sm_path'")"