From d5ade75025f70c94db8603d0baa6a45fdced320a Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 28 Aug 2021 13:48:34 -0400 Subject: [PATCH] Improved workaround for submodule update error --- .../Components/Repository/Repository.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Repository/Repository.cs b/src/Tgstation.Server.Host/Components/Repository/Repository.cs index 0a5107bc62..1f937039d2 100644 --- a/src/Tgstation.Server.Host/Components/Repository/Repository.cs +++ b/src/Tgstation.Server.Host/Components/Repository/Repository.cs @@ -963,8 +963,12 @@ namespace Tgstation.Server.Host.Components.Repository // workaround for https://github.com/libgit2/libgit2/issues/3820 // kill off the modules/ folder in .git and try again CheckBadCredentialsException(ex); - logger.LogWarning(ex, "Initial update of submodule {0} failed. Deleting .git submodule directory and re-attempting...", submodule.Name); - await ioMananger.DeleteDirectory($".git/modules/{submodule.Path}", cancellationToken).ConfigureAwait(false); + logger.LogWarning(ex, "Initial update of submodule {0} failed. Deleting submodule directories and re-attempting...", submodule.Name); + + await Task.WhenAll( + ioMananger.DeleteDirectory($".git/modules/{submodule.Path}", cancellationToken), + ioMananger.DeleteDirectory(submodule.Path, cancellationToken)) + .ConfigureAwait(false); logger.LogTrace("Second update attempt for submodule {0}...", submodule.Name); try