summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-07 12:58:28 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-07 12:58:28 +0100
commita4549e935e29ec8635b9737497d49adc98e2a3d3 (patch)
tree6558516e1beb16958105cc76e18f93ea8c791c2b /include
parent11c47ba7dd76f013f34429ff7b44f0a07ed40211 (diff)
git.sh: reduced indentation in fetch_submodule
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include')
-rwxr-xr-xinclude/git.sh23
1 files changed, 11 insertions, 12 deletions
diff --git a/include/git.sh b/include/git.sh
index 7f4af0c4..17333a86 100755
--- a/include/git.sh
+++ b/include/git.sh
@@ -125,18 +125,17 @@ fetch_submodule()
[ ! -f "$mcfgdir/module.cfg" ] || . "$mcfgdir/module.cfg" || \
$err "! . $mcfgdir/module.cfg"
- if [ -n "$subrepo" ] || [ -n "$subrepo_bkup" ]; then
- [ -n "$subrev" ] || $err "$1, $mdir: subrev not defined"
-
- rm -Rf "$tmpgit/$1" || $err "!rm '$mdir' '$1'"
- for mod in "$subrepo" "$subrepo_bkup"; do
- [ -z "$mod" ] && continue
- git clone "$mod" "$tmpgit/$1" || rm -Rf "$tmpgit/$1" \
- || $err "!rm $mod $project $cfgdir $1"
- [ -d "$tmpgit/$1" ] && break
- done
- [ -d "$tmpgit/$1" ] || $err "!clone $mod $project $mcfgdir $1"
- fi
+ [ -n "$subrepo" ] || [ -n "$subrepo_bkup" ] || return 0
+ [ -n "$subrev" ] || $err "$1, $mdir: subrev not defined"
+
+ rm -Rf "$tmpgit/$1" || $err "!rm '$mdir' '$1'"
+ for mod in "$subrepo" "$subrepo_bkup"; do
+ [ -z "$mod" ] && continue
+ git clone "$mod" "$tmpgit/$1" || rm -Rf "$tmpgit/$1" \
+ || $err "!rm $mod $project $cfgdir $1"
+ [ -d "$tmpgit/$1" ] && break
+ done
+ [ -d "$tmpgit/$1" ] || $err "!clone $mod $project $mcfgdir $1"
}
patch_submodule()