Skip to content

Commit

Permalink
Fixed invalid text showing.
Browse files Browse the repository at this point in the history
  • Loading branch information
glennawatson committed Jul 28, 2016
1 parent 5789cd7 commit 143dffe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Input;
Expand Down Expand Up @@ -412,19 +413,33 @@ private async Task<GitCommandResponse> PerformSquash(CancellationToken token)
}

forcePushOutput = null;
if (!this.ForcePush)
if (this.ForcePush)
{
forcePushOutput = await this.SquashWrapper.PushForce(token);

if (forcePushOutput.Success == false || token.IsCancellationRequested)
{
return forcePushOutput;
}
}

StringBuilder sb = new StringBuilder();
if (squashOutput != null && squashOutput.Success)
{
return new GitCommandResponse(true, $"{rebaseOutput?.CommandOutput}\r\n{squashOutput.CommandOutput}\r\n{forcePushOutput.CommandOutput}");
sb.AppendLine(squashOutput.CommandOutput);
}

forcePushOutput = await this.SquashWrapper.PushForce(token);
if (forcePushOutput != null && forcePushOutput.Success)
{
sb.AppendLine(forcePushOutput.CommandOutput);
}

if (forcePushOutput.Success == false || token.IsCancellationRequested)
if (rebaseOutput != null && rebaseOutput.Success)
{
return forcePushOutput;
sb.AppendLine(rebaseOutput.CommandOutput);
}

return new GitCommandResponse(true, $"{rebaseOutput?.CommandOutput}\r\n{squashOutput.CommandOutput}\r\n{forcePushOutput?.CommandOutput}");
return new GitCommandResponse(true, sb.ToString());
}

private Task<GitCommandResponse> PerformRebase(CancellationToken token)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<Metadata>
<Identity Id="GitSquash.VisualStudio.Extension.Glenn Watson.9d974827-f458-4741-b96c-f6926984b1d8" Version="1.0.0.9" Language="en-US" Publisher="Glenn Watson" />
<Identity Id="GitSquash.VisualStudio.Extension.Glenn Watson.9d974827-f458-4741-b96c-f6926984b1d8" Version="1.0.0.10" Language="en-US" Publisher="Glenn Watson" />
<DisplayName>Git Squash</DisplayName>
<Description xml:space="preserve">Allows rebasing with squash in Visual Studio Team Explorer</Description>
<MoreInfo>https://github.com/glennawatson/GitSquash-VIsualStudio</MoreInfo>
Expand Down

0 comments on commit 143dffe

Please sign in to comment.