From 0d55d7b23a5171134a926841b5c7717ab8e52c65 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 17 Jul 2024 17:28:27 +0100 Subject: [PATCH] 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 --- include/git.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/include/git.sh b/include/git.sh index ff8b0d9..44afd48 100644 --- a/include/git.sh +++ b/include/git.sh @@ -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