summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-07-17 17:28:27 +0100
committerLeah Rowe <leah@libreboot.org>2024-07-17 17:28:27 +0100
commitef867ecccad5464690c4fa342946fa2c7a4eac3d (patch)
tree918c49687309b3831e8798da2e90957df2dfcd53 /include
parent4d5385a14de8f74a54877ec91a877b4f01cf472f (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/git.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/git.sh b/include/git.sh
index ff8b0d97..44afd487 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