diff --git a/src/Stack.Tests/Commands/Stack/StackStatusCommandHandlerTests.cs b/src/Stack.Tests/Commands/Stack/StackStatusCommandHandlerTests.cs index 3f89717..4ba41e4 100644 --- a/src/Stack.Tests/Commands/Stack/StackStatusCommandHandlerTests.cs +++ b/src/Stack.Tests/Commands/Stack/StackStatusCommandHandlerTests.cs @@ -53,7 +53,7 @@ public async Task WhenMultipleBranchesExistInAStack_AndOneHasAPullRequests_Retur .Returns(pr); // Act - var response = await handler.Handle(new StackStatusCommandInputs(null, false, false, true)); + var response = await handler.Handle(new StackStatusCommandInputs(null, false, true)); // Assert var expectedBranchDetails = new Dictionary @@ -113,7 +113,7 @@ public async Task WhenStackNameIsProvided_DoesNotAskForStack_ReturnsStatus() .Returns(pr); // Act - var response = await handler.Handle(new StackStatusCommandInputs("Stack1", false, false, true)); + var response = await handler.Handle(new StackStatusCommandInputs("Stack1", false, true)); // Assert var expectedBranchDetails = new Dictionary @@ -176,7 +176,7 @@ public async Task WhenAllStacksAreRequested_ReturnsStatusOfEachStack() .Returns(pr); // Act - var response = await handler.Handle(new StackStatusCommandInputs(null, true, false, true)); + var response = await handler.Handle(new StackStatusCommandInputs(null, true, true)); // Assert var expectedBranchDetailsForStack1 = new Dictionary @@ -246,7 +246,7 @@ public async Task WhenAllStacksAreRequested_WithStacksInMultipleRepositories_Ret .Returns(pr); // Act - var response = await handler.Handle(new StackStatusCommandInputs(null, true, false, true)); + var response = await handler.Handle(new StackStatusCommandInputs(null, true, true)); // Assert var expectedBranchDetailsForStack1 = new Dictionary @@ -302,7 +302,7 @@ public async Task WhenStackNameIsProvided_ButStackDoesNotExist_Throws() // Act and assert var incorrectStackName = Some.Name(); await handler - .Invoking(async h => await h.Handle(new StackStatusCommandInputs(incorrectStackName, false, false, false))) + .Invoking(async h => await h.Handle(new StackStatusCommandInputs(incorrectStackName, false, false))) .Should().ThrowAsync() .WithMessage($"Stack '{incorrectStackName}' not found."); } @@ -349,7 +349,7 @@ public async Task WhenMultipleBranchesExistInAStack_AndOneNoLongerExistsOnTheRem .Returns(pr); // Act - var response = await handler.Handle(new StackStatusCommandInputs(null, false, false, true)); + var response = await handler.Handle(new StackStatusCommandInputs(null, false, true)); // Assert var expectedBranchDetails = new Dictionary @@ -406,7 +406,7 @@ public async Task WhenMultipleBranchesExistInAStack_AndOneNoLongerExistsOnTheRem .Returns(pr); // Act - var response = await handler.Handle(new StackStatusCommandInputs(null, false, false, true)); + var response = await handler.Handle(new StackStatusCommandInputs(null, false, true)); // Assert var expectedBranchDetails = new Dictionary @@ -463,7 +463,7 @@ public async Task WhenOnlyOneStackExists_DoesNotAskForStackName_ReturnsStatus() .Returns(pr); // Act - var response = await handler.Handle(new StackStatusCommandInputs(null, false, false, true)); + var response = await handler.Handle(new StackStatusCommandInputs(null, false, true)); // Assert var expectedBranchDetails = new Dictionary diff --git a/src/Stack/Commands/Helpers/StackStatusHelpers.cs b/src/Stack/Commands/Helpers/StackStatusHelpers.cs index 6474291..2b5fdb6 100644 --- a/src/Stack/Commands/Helpers/StackStatusHelpers.cs +++ b/src/Stack/Commands/Helpers/StackStatusHelpers.cs @@ -30,7 +30,6 @@ public static class StackStatusHelpers IOutputProvider outputProvider, IGitOperations gitOperations, IGitHubOperations gitHubOperations, - bool includeParentBranchStatus = true, bool includePullRequestStatus = true) { var stacksToCheckStatusFor = new Dictionary(); @@ -62,7 +61,7 @@ public static class StackStatusHelpers if (branchStatus is not null) { - var (aheadOfParent, behindParent) = includeParentBranchStatus && branchStatus.RemoteBranchExists ? gitOperations.CompareBranches(branch, parentBranch) : (0, 0); + var (aheadOfParent, behindParent) = branchStatus.RemoteBranchExists ? gitOperations.CompareBranches(branch, parentBranch) : (0, 0); status.Branches[branch].Status = new BranchStatus(true, branchStatus.RemoteBranchExists, branchStatus.IsCurrentBranch, aheadOfParent, behindParent, branchStatus.Ahead, branchStatus.Behind, branchStatus.Tip); diff --git a/src/Stack/Commands/Stack/StackStatusCommand.cs b/src/Stack/Commands/Stack/StackStatusCommand.cs index 15d7bde..8db34b2 100644 --- a/src/Stack/Commands/Stack/StackStatusCommand.cs +++ b/src/Stack/Commands/Stack/StackStatusCommand.cs @@ -18,10 +18,6 @@ public class StackStatusCommandSettings : CommandSettingsBase [CommandOption("--all")] public bool All { get; init; } - [Description("Show minimal status.")] - [CommandOption("--minimal")] - public bool Minimal { get; init; } - [Description("Show full status including pull requests.")] [CommandOption("--full")] public bool Full { get; init; } @@ -41,13 +37,13 @@ public override async Task ExecuteAsync(CommandContext context, StackStatus new GitHubOperations(outputProvider, settings.GetGitHubOperationSettings()), new StackConfig()); - await handler.Handle(new StackStatusCommandInputs(settings.Name, settings.All, settings.Minimal, settings.Full)); + await handler.Handle(new StackStatusCommandInputs(settings.Name, settings.All, settings.Full)); return 0; } } -public record StackStatusCommandInputs(string? Name, bool All, bool Minimal, bool Full); +public record StackStatusCommandInputs(string? Name, bool All, bool Full); public record StackStatusCommandResponse(Dictionary Statuses); public class StackStatusCommandHandler( @@ -90,7 +86,6 @@ public async Task Handle(StackStatusCommandInputs in outputProvider, gitOperations, gitHubOperations, - !inputs.Minimal, inputs.Full); StackStatusHelpers.OutputStackStatus(stackStatusResults, outputProvider);