diff --git a/TGServerService/Compiler.cs b/TGServerService/Compiler.cs index 5468509f29..d65ad924c4 100644 --- a/TGServerService/Compiler.cs +++ b/TGServerService/Compiler.cs @@ -337,6 +337,7 @@ namespace TGServerService return; } } + string CurrentSha; try { bool silent; @@ -378,7 +379,7 @@ namespace TGServerService deleteExcludeList.Add(".git"); Program.CopyDirectory(RepoPath, resurrectee, deleteExcludeList); - UpdateLiveSha(); + CurrentSha = GetHead(false, out string error); //just the tip const string GitLogsDir = "/.git/logs"; Program.CopyDirectory(RepoPath + GitLogsDir, resurrectee + GitLogsDir); @@ -525,6 +526,7 @@ namespace TGServerService TGServerService.WriteWarning("Postcompile hook failed!", TGServerService.EventID.DMCompileError); return; } + UpdateLiveSha(CurrentSha); var msg = String.Format("Compile complete!{0}", !staged ? "" : " Server will update next round."); SendMessage("DM: " + msg, ChatMessageType.DeveloperInfo); TGServerService.WriteInfo(msg, TGServerService.EventID.DMCompileSuccess); diff --git a/TGServerService/Repository.cs b/TGServerService/Repository.cs index 6f06ee4045..84e759f3ae 100644 --- a/TGServerService/Repository.cs +++ b/TGServerService/Repository.cs @@ -1187,14 +1187,14 @@ namespace TGServerService return Properties.Settings.Default.PythonPath; } - void UpdateLiveSha() + void UpdateLiveSha(string newSha) { if (LoadRepo() != null) return; var B = Repo.Branches[LiveTrackingBranch]; if (B != null) Repo.Branches.Remove(B); - Repo.CreateBranch(LiveTrackingBranch, Repo.Head.Tip); + Repo.CreateBranch(LiveTrackingBranch, newSha); } public string LiveSha()