diff options
author | Leah Rowe <leah@libreboot.org> | 2024-06-20 00:51:04 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2024-06-20 00:51:04 +0100 |
commit | cd1d847898078add88fd17542703806f1c30b522 (patch) | |
tree | 70082440e05814c51b4763159302d3a8189872fd /include/git.sh | |
parent | 4f6dda136663e5efd23a82024439d7a40c7bb349 (diff) |
git.sh: reduced indentation on repo/file check
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/git.sh')
-rwxr-xr-x | include/git.sh | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/git.sh b/include/git.sh index 01ebff4b..a4543e99 100755 --- a/include/git.sh +++ b/include/git.sh @@ -130,13 +130,11 @@ fetch_submodule() chkvars "sub${st}" "sub${st}_bkup" "subhash" - if [ "$st" = "repo" ]; then - rm -Rf "$tmpgit/$1" || $err "!rm '$mdir' '$1'" - tmpclone "$subrepo" "$subrepo_bkup" "$tmpgit/$1" "$subhash" \ - "$mdir/${1##*/}/patches" - else - download "$subfile" "$subfile_bkup" "$tmpgit/$1" "$subhash" - fi + [ "$st" != "repo" ] && download "$subfile" "$subfile_bkup" \ + "$tmpgit/$1" "$subhash" && return 0 + rm -Rf "$tmpgit/$1" || $err "!rm '$mdir' '$1'" + tmpclone "$subrepo" "$subrepo_bkup" "$tmpgit/$1" "$subhash" \ + "$mdir/${1##*/}/patches" } tmpclone() |