mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-26 22:48:20 +01:00
Merge pull request #280 from Cyberboss/FixSub
Catches submodule update exception
This commit is contained in:
@@ -276,8 +276,9 @@ namespace TGServerService
|
||||
IRCLogModes = 6500,
|
||||
/// <summary>
|
||||
/// Warning: When the Repository submodule handler has to reclone a submodule entirely. This is a long operation and is due to an upstream bug
|
||||
/// Error: When a submodule update operation fails completely
|
||||
/// </summary>
|
||||
SubmoduleReclone = 6600,
|
||||
Submodule = 6600,
|
||||
/// <summary>
|
||||
/// This event is of type <see cref="System.Diagnostics.EventLogEntryType.SuccessAudit"/> or <see cref="System.Diagnostics.EventLogEntryType.FailureAudit"/>. It occurs when a user different from the previous one tries and either succeeds or fails to access a <see cref="ServerInstance"/>. DreamDaemon itself successfully accessing <see cref="TGServiceInterface.Components.ITGInterop"/> will not trigger this
|
||||
/// </summary>
|
||||
|
||||
@@ -637,20 +637,27 @@ namespace TGServerService
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//workaround for https://github.com/libgit2/libgit2/issues/3820
|
||||
//kill off the modules/ folder in .git and try again
|
||||
try
|
||||
{
|
||||
Program.DeleteDirectory(String.Format("{0}/.git/modules/{1}", RepoPath, I.Path));
|
||||
//workaround for https://github.com/libgit2/libgit2/issues/3820
|
||||
//kill off the modules/ folder in .git and try again
|
||||
try
|
||||
{
|
||||
Program.DeleteDirectory(String.Format("{0}/.git/modules/{1}", RepoPath, I.Path));
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
Repo.Submodules.Update(I.Name, suo);
|
||||
var msg = String.Format("I had to reclone submodule {0}. If this is happening a lot find a better hack or fix https://github.com/libgit2/libgit2/issues/3820!", I.Name);
|
||||
SendMessage(String.Format("REPO: {0}", msg), MessageType.DeveloperInfo);
|
||||
Service.WriteWarning(msg, EventID.Submodule);
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw e;
|
||||
Service.WriteError(String.Format("Failed to update submodule {0}! Error: {1}", I.Name, ex.ToString()), EventID.Submodule);
|
||||
}
|
||||
Repo.Submodules.Update(I.Name, suo);
|
||||
var msg = String.Format("I had to reclone submodule {0}. If this is happening a lot find a better hack or fix https://github.com/libgit2/libgit2/issues/3820!", I.Name);
|
||||
SendMessage(String.Format("REPO: {0}", msg), MessageType.DeveloperInfo);
|
||||
Service.WriteWarning(msg, EventID.SubmoduleReclone);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user