Skip to content

Commit 143dffe

Browse files
committed
Fixed invalid text showing.
1 parent 5789cd7 commit 143dffe

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

GitSquash.VisualStudio.Extension/GitSquash.VisualStudio.Extension/ViewModel/SquashViewModel.cs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Collections.Generic;
55
using System.ComponentModel;
66
using System.Linq;
7+
using System.Text;
78
using System.Threading;
89
using System.Threading.Tasks;
910
using System.Windows.Input;
@@ -412,19 +413,33 @@ private async Task<GitCommandResponse> PerformSquash(CancellationToken token)
412413
}
413414

414415
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)
416428
{
417-
return new GitCommandResponse(true, $"{rebaseOutput?.CommandOutput}\r\n{squashOutput.CommandOutput}\r\n{forcePushOutput.CommandOutput}");
429+
sb.AppendLine(squashOutput.CommandOutput);
418430
}
419431

420-
forcePushOutput = await this.SquashWrapper.PushForce(token);
432+
if (forcePushOutput != null && forcePushOutput.Success)
433+
{
434+
sb.AppendLine(forcePushOutput.CommandOutput);
435+
}
421436

422-
if (forcePushOutput.Success == false || token.IsCancellationRequested)
437+
if (rebaseOutput != null && rebaseOutput.Success)
423438
{
424-
return forcePushOutput;
439+
sb.AppendLine(rebaseOutput.CommandOutput);
425440
}
426441

427-
return new GitCommandResponse(true, $"{rebaseOutput?.CommandOutput}\r\n{squashOutput.CommandOutput}\r\n{forcePushOutput?.CommandOutput}");
442+
return new GitCommandResponse(true, sb.ToString());
428443
}
429444

430445
private Task<GitCommandResponse> PerformRebase(CancellationToken token)

GitSquash.VisualStudio.Extension/GitSquash.VisualStudio.Extension/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="GitSquash.VisualStudio.Extension.Glenn Watson.9d974827-f458-4741-b96c-f6926984b1d8" Version="1.0.0.9" Language="en-US" Publisher="Glenn Watson" />
4+
<Identity Id="GitSquash.VisualStudio.Extension.Glenn Watson.9d974827-f458-4741-b96c-f6926984b1d8" Version="1.0.0.10" Language="en-US" Publisher="Glenn Watson" />
55
<DisplayName>Git Squash</DisplayName>
66
<Description xml:space="preserve">Allows rebasing with squash in Visual Studio Team Explorer</Description>
77
<MoreInfo>https://github.com/glennawatson/GitSquash-VIsualStudio</MoreInfo>

0 commit comments

Comments
 (0)