|
4 | 4 | using System.Collections.Generic;
|
5 | 5 | using System.ComponentModel;
|
6 | 6 | using System.Linq;
|
| 7 | + using System.Text; |
7 | 8 | using System.Threading;
|
8 | 9 | using System.Threading.Tasks;
|
9 | 10 | using System.Windows.Input;
|
@@ -412,19 +413,33 @@ private async Task<GitCommandResponse> PerformSquash(CancellationToken token)
|
412 | 413 | }
|
413 | 414 |
|
414 | 415 | forcePushOutput = null;
|
415 |
| - if (!this.ForcePush) |
| 416 | + if (this.ForcePush) |
| 417 | + { |
| 418 | + forcePushOutput = await this.SquashWrapper.PushForce(token); |
| 419 | + |
| 420 | + if (forcePushOutput.Success == false || token.IsCancellationRequested) |
| 421 | + { |
| 422 | + return forcePushOutput; |
| 423 | + } |
| 424 | + } |
| 425 | + |
| 426 | + StringBuilder sb = new StringBuilder(); |
| 427 | + if (squashOutput != null && squashOutput.Success) |
416 | 428 | {
|
417 |
| - return new GitCommandResponse(true, $"{rebaseOutput?.CommandOutput}\r\n{squashOutput.CommandOutput}\r\n{forcePushOutput.CommandOutput}"); |
| 429 | + sb.AppendLine(squashOutput.CommandOutput); |
418 | 430 | }
|
419 | 431 |
|
420 |
| - forcePushOutput = await this.SquashWrapper.PushForce(token); |
| 432 | + if (forcePushOutput != null && forcePushOutput.Success) |
| 433 | + { |
| 434 | + sb.AppendLine(forcePushOutput.CommandOutput); |
| 435 | + } |
421 | 436 |
|
422 |
| - if (forcePushOutput.Success == false || token.IsCancellationRequested) |
| 437 | + if (rebaseOutput != null && rebaseOutput.Success) |
423 | 438 | {
|
424 |
| - return forcePushOutput; |
| 439 | + sb.AppendLine(rebaseOutput.CommandOutput); |
425 | 440 | }
|
426 | 441 |
|
427 |
| - return new GitCommandResponse(true, $"{rebaseOutput?.CommandOutput}\r\n{squashOutput.CommandOutput}\r\n{forcePushOutput?.CommandOutput}"); |
| 442 | + return new GitCommandResponse(true, sb.ToString()); |
428 | 443 | }
|
429 | 444 |
|
430 | 445 | private Task<GitCommandResponse> PerformRebase(CancellationToken token)
|
|
0 commit comments