From 8d5475ed5b55b01290d09ff06a29ae3c6da119fa Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 14 May 2025 16:48:25 +0100 Subject: get.sh: simplify fetch_submodules() config check We already do what the old code does in setcfg, by virtue of the fact that the st variable is later checked, after loading this config conditionally, where the st variable is otherwise blank. We can avoid the unnecessary work after loading the config, by returning if the config is absent. Signed-off-by: Leah Rowe --- include/get.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/get.sh b/include/get.sh index e582fdd8..120d4264 100644 --- a/include/get.sh +++ b/include/get.sh @@ -66,8 +66,7 @@ fetch_submodule() { mcfgdir="$mdir/${1##*/}"; eval \ "`setvars "" subhash subgit subgit_bkup subcurl subcurl_bkup st`" - [ ! -f "$mcfgdir/module.cfg" ] || . "$mcfgdir/module.cfg" || \ - err "! . $mcfgdir/module.cfg" + eval "`setcfg "$mcfgdir/module.cfg" 0`" for xt in git curl; do _seval="if [ -n \"\$sub$xt\" ] || [ -n \"\$sub${xt}_bkup\" ]" -- cgit v1.2.1