Improved workaround for submodule update error

This commit is contained in:
Jordan Brown
2021-08-28 13:48:34 -04:00
parent 27083b7c2b
commit d5ade75025
@@ -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