This commit is contained in:
Cyberboss
2017-10-12 22:17:55 -04:00
parent 7b907dff27
commit e259881a2e
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -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);
+2 -2
View File
@@ -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()