|
@@ -499,51 +499,6 @@ namespace Terra.Arbitrator.Services
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static async void ForcePullExecutor(Action<string> resolve, Action<Exception> reject)
|
|
|
- {
|
|
|
- var log = new StringBuilder();
|
|
|
- var hasStashed = false;
|
|
|
-
|
|
|
- try
|
|
|
- {
|
|
|
- using (var repo = new Repository(ProjectRoot))
|
|
|
- {
|
|
|
- if (repo.RetrieveStatus().IsDirty)
|
|
|
- {
|
|
|
- await GitCommand.RunGitAsync(log, new[] { "stash", "push", "-u", "-m", "BetterGit-WIP-Pull" }, 0, 141);
|
|
|
- hasStashed = true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- await GitCommand.RunGitAsync(log, new[] { "pull", "--no-rebase" }, 0, 1, 141);
|
|
|
-
|
|
|
- if (hasStashed)
|
|
|
- {
|
|
|
- await GitCommand.RunGitAsync(log, new[] { "stash", "pop" }, 0, 1, 141);
|
|
|
- await GitCommand.RunGitAsync(log, new[] { "stash", "drop" }, 0, 141);
|
|
|
- }
|
|
|
-
|
|
|
- resolve(log.ToString());
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- if (hasStashed)
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- await GitCommand.RunGitAsync(new StringBuilder(), new[] { "stash", "pop" }, 0, 1, 141);
|
|
|
- }
|
|
|
- catch (Exception exception)
|
|
|
- {
|
|
|
- log.AppendLine($"Fatal Error trying to pop stash after a failed pull: {exception.Message}");
|
|
|
- }
|
|
|
- }
|
|
|
- log.AppendLine("\n--- PULL FAILED ---");
|
|
|
- log.AppendLine(ex.ToString());
|
|
|
- reject(new Exception(log.ToString()));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
public static async void PullAndOverwriteExecutor(Action<string> resolve, Action<Exception> reject, List<GitChange> resolutions)
|
|
|
{
|
|
|
var tempFiles = new Dictionary<string, string>();
|
|
@@ -567,7 +522,7 @@ namespace Terra.Arbitrator.Services
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- await GitCommand.RunGitAsync(log, new[] { "pull", "--no-rebase" });
|
|
|
+ await GitCommand.RunGitAsync(log, new[] { "pull", "--no-rebase" }, 0, 1, 141);
|
|
|
|
|
|
foreach (var entry in tempFiles)
|
|
|
{
|