git.sh: remove previous tmprepo if args>5

if doing a retry, the directory may still exist, which
would make git clone yield an error response; the existing
directory will have been the one that failed to reset, so
let's delete it.

the one deleted is not the cache (repo/PROJECT/), thus
otherwise maintaining current behaviour.

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit6
Leah Rowe 2024-07-17 17:28:27 +01:00
parent 4d5385a14d
commit ef867eccca
1 changed files with 1 additions and 0 deletions

View File

@ -100,6 +100,7 @@ fetch_submodule()
tmpclone()
{
[ $# -lt 6 ] || rm -Rf "$3" || $err "git retry: !rm $3 ($1)"
repodir="repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3"
x_ mkdir -p "repo"
if [ -d "$repodir" ] && [ $# -lt 6 ]; then