Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds stack sync command #166

Merged
merged 68 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
215b859
Show local status by default in status command
geofflamrock Dec 20, 2024
8084392
Make showing status much better and quicker
geofflamrock Dec 20, 2024
b30c303
Remove `--minimal` option for now
geofflamrock Dec 20, 2024
1b318b6
Separate git branch status parsing
geofflamrock Dec 20, 2024
24e37be
Revert change to detecting remote branches for other commands
geofflamrock Dec 20, 2024
4410d0b
Cleanup
geofflamrock Dec 20, 2024
369aba4
Adds pull command
geofflamrock Dec 20, 2024
bba932f
Tiny improvement to output when getting status of single stack
geofflamrock Dec 20, 2024
6b573fb
wip pull tests
geofflamrock Dec 20, 2024
1925602
Add more tests
geofflamrock Dec 24, 2024
e0f25ec
Merge branch 'main' into stack-status-local-by-default
geofflamrock Dec 27, 2024
785d5cd
Merge branch 'stack-status-local-by-default' into add-pull-command
geofflamrock Dec 27, 2024
4df13a8
Improve getting tip of remote branch
geofflamrock Dec 27, 2024
e95e5cb
Adds push command
geofflamrock Dec 27, 2024
734fae3
Add formatting
geofflamrock Dec 27, 2024
d167733
Testing out capturing std err
geofflamrock Dec 27, 2024
3254a3a
Make std err optional
geofflamrock Dec 27, 2024
4b00fa2
Merge branch 'main' into stack-status-local-by-default
geofflamrock Dec 27, 2024
294c403
Merge branch 'stack-status-local-by-default' into add-pull-command
geofflamrock Dec 27, 2024
9bcc789
Merge branch 'add-pull-command' into add-push-command
geofflamrock Dec 27, 2024
e5f81ec
Make formatting less noisy
geofflamrock Dec 27, 2024
0d2ad4e
Merge branch 'stack-status-local-by-default' into add-pull-command
geofflamrock Dec 27, 2024
99fea49
Merge branch 'add-pull-command' into add-push-command
geofflamrock Dec 27, 2024
9a1c158
Add tests
geofflamrock Dec 27, 2024
2f543b0
Push new branch if required
geofflamrock Dec 27, 2024
1d953e2
Adds --no-push option to new stack creation
geofflamrock Dec 30, 2024
f8295da
Add --push option to new branch creation
geofflamrock Dec 30, 2024
b1eac2e
Update help
geofflamrock Dec 30, 2024
a0a8d7d
Update help and readme
geofflamrock Dec 30, 2024
1ce8196
Update help
geofflamrock Dec 30, 2024
9c64936
Merge branch 'stack-status-local-by-default' into add-pull-command
geofflamrock Dec 30, 2024
2103554
Merge branch 'add-pull-command' into add-push-command
geofflamrock Dec 30, 2024
a58a7f0
Merge branch 'add-push-command' into add-push-option-to-new-branch
geofflamrock Dec 30, 2024
4d5fcc5
Update readme
geofflamrock Dec 30, 2024
efdeb61
Update readme
geofflamrock Dec 30, 2024
d6246e7
Merge branch 'add-push-command' into add-push-option-to-new-branch
geofflamrock Dec 30, 2024
77859ff
Add sync command
geofflamrock Dec 30, 2024
1c4c956
Add tests
geofflamrock Dec 30, 2024
5de387c
Cleanup
geofflamrock Dec 30, 2024
cef041f
More cleanup
geofflamrock Dec 30, 2024
009017d
Cleanup
geofflamrock Dec 30, 2024
f07c1be
Merge branch 'add-pull-command' into add-push-command
geofflamrock Dec 30, 2024
59c5613
Merge branch 'add-push-command' into add-push-option-to-new-branch
geofflamrock Dec 30, 2024
1155a0b
Merge branch 'add-push-option-to-new-branch' into add-sync-command
geofflamrock Dec 30, 2024
2079a48
Cleanup
geofflamrock Dec 30, 2024
b503c1a
Merge branch 'add-push-command' into add-push-option-to-new-branch
geofflamrock Dec 30, 2024
017e8b9
Merge branch 'add-push-option-to-new-branch' into add-sync-command
geofflamrock Dec 30, 2024
a71d84e
Remove force options
geofflamrock Dec 30, 2024
3b9ec24
Merge branch 'add-push-command' into add-push-option-to-new-branch
geofflamrock Dec 30, 2024
5f85ea6
Merge branch 'add-push-option-to-new-branch' into add-sync-command
geofflamrock Dec 30, 2024
6b8b7dc
Cleanup
geofflamrock Dec 30, 2024
8c39898
Merge branch 'stack-status-local-by-default' into add-pull-command
geofflamrock Dec 30, 2024
6a12e0e
Merge branch 'add-pull-command' into add-push-command
geofflamrock Dec 30, 2024
12b922b
Merge branch 'add-push-command' into add-push-option-to-new-branch
geofflamrock Dec 30, 2024
d358b3f
Merge branch 'add-push-option-to-new-branch' into add-sync-command
geofflamrock Dec 30, 2024
ca965d7
Update readme and fix build
geofflamrock Dec 30, 2024
c22f3a0
Merge branch 'main' into add-pull-command
geofflamrock Dec 30, 2024
41c49ce
Merge branch 'add-pull-command' into add-push-command
geofflamrock Dec 30, 2024
b6170e5
Merge branch 'add-push-command' into add-push-option-to-new-branch
geofflamrock Dec 30, 2024
a4a08b7
Merge branch 'add-push-option-to-new-branch' into add-sync-command
geofflamrock Dec 30, 2024
8a0f05c
Merge branch 'main' into add-push-command
geofflamrock Dec 30, 2024
7337fb5
Merge branch 'add-push-command' into add-push-option-to-new-branch
geofflamrock Dec 30, 2024
8ca03e2
Merge branch 'add-push-option-to-new-branch' into add-sync-command
geofflamrock Dec 30, 2024
77097d9
Move fetch to before status
geofflamrock Dec 30, 2024
cb07ff6
Merge branch 'main' into add-push-option-to-new-branch
geofflamrock Dec 30, 2024
d9a32bd
Merge branch 'add-push-option-to-new-branch' into add-sync-command
geofflamrock Dec 30, 2024
2d617d8
Merge branch 'main' into add-sync-command
geofflamrock Dec 30, 2024
3f4a0e0
More readme improvements
geofflamrock Dec 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 36 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ To create a stack:
- Optionally either create a new branch from the source branch, or add an existing branch to the stack.
- If you chose to create or add a branch you can switch to that branch to start work.

By default new branches are only created locally, you can either use the `--push` option or use the `stack push` command to push the branch to the remote.

### Working within a stack

Working within a stack is the same as working with Git as per normal, make your changes on the branch, commit them and push them to the remote. You likely have your own tooling and workflows for this, you can continue to use them.
Expand All @@ -64,22 +66,22 @@ Once you've done some work on the first branch within the stack, at some point y

The new branch will be created from the branch at the bottom of the stack and you can then switch to the branch if you would like to in order to make more changes.

### Updating a stack
By default new branches are only created locally, you can either use the `--push` option or use the `stack push` command to push the branch to the remote.

### Syncing a stack

After working on a stack of branches for a while, you might need to incorporate changes that have happened to your source branch from others. To do this:

- Run `stack update`
- Select the stack you wish to update
- Confirm the update
- Run `stack sync`
- Select the stack you wish to sync
- Confirm the sync

Branches in the stack will be updated by:

- Fetching the latest changes from the remote for all branches in the stack, including the source branch.
- Merging from the source branch to the first branch in the stack.
- Pushing changes for the first branch to the remote.
- Merging from the first branch to the second branch in the stack (if one exists).
- Pushing changes for the second branch to the remote.
- Repeating this until all branches are updated.
- Fetching changes to the repository, pruning remote branches that no longer exist, the equivalent of running `git fetch --prune`.
- Pulling changes for all branches in the stack, including the source branch, the equivalent of running `stack pull`.
- Updating branches in order in the stack, the equivalent of running `stack update`.
- Pushing changes for all branches in the stack, the equivalent of running `stack push`.

#### Rough edges

Expand Down Expand Up @@ -286,9 +288,10 @@ OPTIONS:

### `stack pull`

```shell
Pulls changes from the remote repository for a stack.

```shell

USAGE:
stack pull [OPTIONS]

Expand All @@ -303,9 +306,10 @@ OPTIONS:

### `stack push`

```shell
Pushes changes to the remote repository for a stack.

```shell

USAGE:
stack push [OPTIONS]

Expand All @@ -319,6 +323,26 @@ OPTIONS:
--max-batch-size The maximum number of branches to push changes for at once (default: 5)
```

### `stack sync`

Syncs a stack with the remote repository. Shortcut for `git fetch --prune`, `stack pull`, `stack update` and `stack push`.

```shell

USAGE:
stack sync [OPTIONS]

OPTIONS:
-h, --help Prints help information
-v, --version Prints version information
--verbose Show verbose output
--working-dir The path to the directory containing the git repository. Defaults to the current directory
--dry-run Show what would happen without making any changes
-n, --name The name of the stack to update
-y, --yes Don't ask for confirmation before syncing the stack
--max-batch-size The maximum number of branches to push changes for at once (default: 5)
```

## GitHub commands

### `stack pr create`
Expand Down
265 changes: 265 additions & 0 deletions src/Stack.Tests/Commands/Remote/SyncStackCommandHandlerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
using FluentAssertions;
using NSubstitute;
using Stack.Commands;
using Stack.Config;
using Stack.Git;
using Stack.Tests.Helpers;
using Stack.Infrastructure;
using Stack.Commands.Helpers;
using Xunit.Abstractions;

namespace Stack.Tests.Commands.Remote;

public class SyncStackCommandHandlerTests(ITestOutputHelper testOutputHelper)
{
[Fact]
public async Task WhenChangesExistOnTheSourceBranchOnTheRemote_PullsChanges_UpdatesBranches_AndPushesToRemote()
{
// Arrange
var sourceBranch = Some.BranchName();
var branch1 = Some.BranchName();
var branch2 = Some.BranchName();
using var repo = new TestGitRepositoryBuilder()
.WithBranch(builder => builder.WithName(sourceBranch).PushToRemote())
.WithBranch(builder => builder.WithName(branch1).FromSourceBranch(sourceBranch).WithNumberOfEmptyCommits(10).PushToRemote())
.WithBranch(builder => builder.WithName(branch2).FromSourceBranch(branch1).WithNumberOfEmptyCommits(1).PushToRemote())
.WithNumberOfEmptyCommitsOnRemoteTrackingBranchOf(sourceBranch, 5, b => b.PushToRemote())
.Build();

var tipOfRemoteSourceBranch = repo.GetTipOfRemoteBranch(sourceBranch);
repo.GetCommitsReachableFromBranch(sourceBranch).Should().NotContain(tipOfRemoteSourceBranch);

var stackConfig = Substitute.For<IStackConfig>();
var inputProvider = Substitute.For<IInputProvider>();
var outputProvider = new TestOutputProvider(testOutputHelper);
var gitOperations = new GitOperations(outputProvider, repo.GitOperationSettings);
var gitHubOperations = Substitute.For<IGitHubOperations>();
var handler = new SyncStackCommandHandler(inputProvider, outputProvider, gitOperations, gitHubOperations, stackConfig);

gitOperations.ChangeBranch(branch1);

var stack1 = new Config.Stack("Stack1", repo.RemoteUri, sourceBranch, [branch1, branch2]);
var stack2 = new Config.Stack("Stack2", repo.RemoteUri, sourceBranch, []);
var stacks = new List<Config.Stack>([stack1, stack2]);
stackConfig.Load().Returns(stacks);

inputProvider.Select(Questions.SelectStack, Arg.Any<string[]>()).Returns("Stack1");
inputProvider.Confirm(Questions.ConfirmSyncStack).Returns(true);

// Act
await handler.Handle(new SyncStackCommandInputs(null, false, 5));

// Assert
repo.GetCommitsReachableFromRemoteBranch(branch1).Should().Contain(tipOfRemoteSourceBranch);
repo.GetCommitsReachableFromRemoteBranch(branch2).Should().Contain(tipOfRemoteSourceBranch);
}

[Fact]
public async Task WhenNameIsProvided_DoesNotAskForName_SyncsCorrectStack()
{
// Arrange
var sourceBranch = Some.BranchName();
var branch1 = Some.BranchName();
var branch2 = Some.BranchName();
using var repo = new TestGitRepositoryBuilder()
.WithBranch(builder => builder.WithName(sourceBranch).PushToRemote())
.WithBranch(builder => builder.WithName(branch1).FromSourceBranch(sourceBranch).WithNumberOfEmptyCommits(10).PushToRemote())
.WithBranch(builder => builder.WithName(branch2).FromSourceBranch(branch1).WithNumberOfEmptyCommits(1).PushToRemote())
.WithNumberOfEmptyCommitsOnRemoteTrackingBranchOf(sourceBranch, 5, b => b.PushToRemote())
.Build();

var tipOfRemoteSourceBranch = repo.GetTipOfRemoteBranch(sourceBranch);
repo.GetCommitsReachableFromBranch(sourceBranch).Should().NotContain(tipOfRemoteSourceBranch);

var stackConfig = Substitute.For<IStackConfig>();
var inputProvider = Substitute.For<IInputProvider>();
var outputProvider = new TestOutputProvider(testOutputHelper);
var gitOperations = new GitOperations(outputProvider, repo.GitOperationSettings);
var gitHubOperations = Substitute.For<IGitHubOperations>();
var handler = new SyncStackCommandHandler(inputProvider, outputProvider, gitOperations, gitHubOperations, stackConfig);

gitOperations.ChangeBranch(branch1);

var stack1 = new Config.Stack("Stack1", repo.RemoteUri, sourceBranch, [branch1, branch2]);
var stack2 = new Config.Stack("Stack2", repo.RemoteUri, sourceBranch, []);
var stacks = new List<Config.Stack>([stack1, stack2]);
stackConfig.Load().Returns(stacks);

inputProvider.Confirm(Questions.ConfirmSyncStack).Returns(true);

// Act
await handler.Handle(new SyncStackCommandInputs("Stack1", false, 5));

// Assert
repo.GetCommitsReachableFromRemoteBranch(branch1).Should().Contain(tipOfRemoteSourceBranch);
repo.GetCommitsReachableFromRemoteBranch(branch2).Should().Contain(tipOfRemoteSourceBranch);
inputProvider.DidNotReceive().Select(Questions.SelectStack, Arg.Any<string[]>());
}

[Fact]
public async Task WhenNoConfirmIsProvided_DoesNotAskForConfirmation()
{
// Arrange
var sourceBranch = Some.BranchName();
var branch1 = Some.BranchName();
var branch2 = Some.BranchName();
using var repo = new TestGitRepositoryBuilder()
.WithBranch(builder => builder.WithName(sourceBranch).PushToRemote())
.WithBranch(builder => builder.WithName(branch1).FromSourceBranch(sourceBranch).WithNumberOfEmptyCommits(10).PushToRemote())
.WithBranch(builder => builder.WithName(branch2).FromSourceBranch(branch1).WithNumberOfEmptyCommits(1).PushToRemote())
.WithNumberOfEmptyCommitsOnRemoteTrackingBranchOf(sourceBranch, 5, b => b.PushToRemote())
.Build();

var tipOfRemoteSourceBranch = repo.GetTipOfRemoteBranch(sourceBranch);
repo.GetCommitsReachableFromBranch(sourceBranch).Should().NotContain(tipOfRemoteSourceBranch);

var stackConfig = Substitute.For<IStackConfig>();
var inputProvider = Substitute.For<IInputProvider>();
var outputProvider = new TestOutputProvider(testOutputHelper);
var gitOperations = new GitOperations(outputProvider, repo.GitOperationSettings);
var gitHubOperations = Substitute.For<IGitHubOperations>();
var handler = new SyncStackCommandHandler(inputProvider, outputProvider, gitOperations, gitHubOperations, stackConfig);

gitOperations.ChangeBranch(branch1);

var stack1 = new Config.Stack("Stack1", repo.RemoteUri, sourceBranch, [branch1, branch2]);
var stack2 = new Config.Stack("Stack2", repo.RemoteUri, sourceBranch, []);
var stacks = new List<Config.Stack>([stack1, stack2]);
stackConfig.Load().Returns(stacks);

inputProvider.Select(Questions.SelectStack, Arg.Any<string[]>()).Returns("Stack1");

// Act
await handler.Handle(new SyncStackCommandInputs(null, true, 5));

// Assert
repo.GetCommitsReachableFromRemoteBranch(branch1).Should().Contain(tipOfRemoteSourceBranch);
repo.GetCommitsReachableFromRemoteBranch(branch2).Should().Contain(tipOfRemoteSourceBranch);
inputProvider.DidNotReceive().Confirm(Questions.ConfirmSyncStack);
}

[Fact]
public async Task WhenNameIsProvided_ButStackDoesNotExist_Throws()
{
// Arrange
var sourceBranch = Some.BranchName();
var branch1 = Some.BranchName();
var branch2 = Some.BranchName();
using var repo = new TestGitRepositoryBuilder()
.WithBranch(builder => builder.WithName(sourceBranch).PushToRemote())
.WithBranch(builder => builder.WithName(branch1).FromSourceBranch(sourceBranch).WithNumberOfEmptyCommits(10).PushToRemote())
.WithBranch(builder => builder.WithName(branch2).FromSourceBranch(branch1).WithNumberOfEmptyCommits(1).PushToRemote())
.WithNumberOfEmptyCommitsOnRemoteTrackingBranchOf(sourceBranch, 5, b => b.PushToRemote())
.Build();

var tipOfRemoteSourceBranch = repo.GetTipOfRemoteBranch(sourceBranch);
repo.GetCommitsReachableFromBranch(sourceBranch).Should().NotContain(tipOfRemoteSourceBranch);

var stackConfig = Substitute.For<IStackConfig>();
var inputProvider = Substitute.For<IInputProvider>();
var outputProvider = new TestOutputProvider(testOutputHelper);
var gitOperations = new GitOperations(outputProvider, repo.GitOperationSettings);
var gitHubOperations = Substitute.For<IGitHubOperations>();
var handler = new SyncStackCommandHandler(inputProvider, outputProvider, gitOperations, gitHubOperations, stackConfig);

gitOperations.ChangeBranch(branch1);

var stack1 = new Config.Stack("Stack1", repo.RemoteUri, sourceBranch, [branch1, branch2]);
var stack2 = new Config.Stack("Stack2", repo.RemoteUri, sourceBranch, []);
var stacks = new List<Config.Stack>([stack1, stack2]);
stackConfig.Load().Returns(stacks);

// Act and assert
var invalidStackName = Some.Name();
await handler.Invoking(async h => await h.Handle(new SyncStackCommandInputs(invalidStackName, false, 5)))
.Should().ThrowAsync<InvalidOperationException>()
.WithMessage($"Stack '{invalidStackName}' not found.");
}

[Fact]
public async Task WhenOnASpecificBranchInTheStack_TheSameBranchIsSetAsCurrentAfterTheSync()
{
// Arrange
var sourceBranch = Some.BranchName();
var branch1 = Some.BranchName();
var branch2 = Some.BranchName();
using var repo = new TestGitRepositoryBuilder()
.WithBranch(builder => builder.WithName(sourceBranch).PushToRemote())
.WithBranch(builder => builder.WithName(branch1).FromSourceBranch(sourceBranch).WithNumberOfEmptyCommits(10).PushToRemote())
.WithBranch(builder => builder.WithName(branch2).FromSourceBranch(branch1).WithNumberOfEmptyCommits(1).PushToRemote())
.WithNumberOfEmptyCommitsOnRemoteTrackingBranchOf(sourceBranch, 5, b => b.PushToRemote())
.Build();

var tipOfRemoteSourceBranch = repo.GetTipOfRemoteBranch(sourceBranch);
repo.GetCommitsReachableFromBranch(sourceBranch).Should().NotContain(tipOfRemoteSourceBranch);

var stackConfig = Substitute.For<IStackConfig>();
var inputProvider = Substitute.For<IInputProvider>();
var outputProvider = new TestOutputProvider(testOutputHelper);
var gitOperations = new GitOperations(outputProvider, repo.GitOperationSettings);
var gitHubOperations = Substitute.For<IGitHubOperations>();
var handler = new SyncStackCommandHandler(inputProvider, outputProvider, gitOperations, gitHubOperations, stackConfig);

// We are on a specific branch in the stack
gitOperations.ChangeBranch(branch1);

var stack1 = new Config.Stack("Stack1", repo.RemoteUri, sourceBranch, [branch1, branch2]);
var stack2 = new Config.Stack("Stack2", repo.RemoteUri, sourceBranch, []);
var stacks = new List<Config.Stack>([stack1, stack2]);
stackConfig.Load().Returns(stacks);

inputProvider.Select(Questions.SelectStack, Arg.Any<string[]>()).Returns("Stack1");
inputProvider.Confirm(Questions.ConfirmSyncStack).Returns(true);

// Act
await handler.Handle(new SyncStackCommandInputs(null, false, 5));

// Assert
repo.GetCommitsReachableFromRemoteBranch(branch1).Should().Contain(tipOfRemoteSourceBranch);
repo.GetCommitsReachableFromRemoteBranch(branch2).Should().Contain(tipOfRemoteSourceBranch);
gitOperations.GetCurrentBranch().Should().Be(branch1);
}

[Fact]
public async Task WhenOnlyASingleStackExists_DoesNotAskForStackName_SyncsStack()
{
// Arrange
var sourceBranch = Some.BranchName();
var branch1 = Some.BranchName();
var branch2 = Some.BranchName();
using var repo = new TestGitRepositoryBuilder()
.WithBranch(builder => builder.WithName(sourceBranch).PushToRemote())
.WithBranch(builder => builder.WithName(branch1).FromSourceBranch(sourceBranch).WithNumberOfEmptyCommits(10).PushToRemote())
.WithBranch(builder => builder.WithName(branch2).FromSourceBranch(branch1).WithNumberOfEmptyCommits(1).PushToRemote())
.WithNumberOfEmptyCommitsOnRemoteTrackingBranchOf(sourceBranch, 5, b => b.PushToRemote())
.Build();

var tipOfRemoteSourceBranch = repo.GetTipOfRemoteBranch(sourceBranch);
repo.GetCommitsReachableFromBranch(sourceBranch).Should().NotContain(tipOfRemoteSourceBranch);

var stackConfig = Substitute.For<IStackConfig>();
var inputProvider = Substitute.For<IInputProvider>();
var outputProvider = new TestOutputProvider(testOutputHelper);
var gitOperations = new GitOperations(outputProvider, repo.GitOperationSettings);
var gitHubOperations = Substitute.For<IGitHubOperations>();
var handler = new SyncStackCommandHandler(inputProvider, outputProvider, gitOperations, gitHubOperations, stackConfig);

gitOperations.ChangeBranch(branch1);

var stack1 = new Config.Stack("Stack1", repo.RemoteUri, sourceBranch, [branch1, branch2]);
var stacks = new List<Config.Stack>([stack1]);
stackConfig.Load().Returns(stacks);

inputProvider.Confirm(Questions.ConfirmSyncStack).Returns(true);

// Act
await handler.Handle(new SyncStackCommandInputs(null, false, 5));

// Assert
repo.GetCommitsReachableFromRemoteBranch(branch1).Should().Contain(tipOfRemoteSourceBranch);
repo.GetCommitsReachableFromRemoteBranch(branch2).Should().Contain(tipOfRemoteSourceBranch);
gitOperations.GetCurrentBranch().Should().Be(branch1);

inputProvider.DidNotReceive().Select(Questions.SelectStack, Arg.Any<string[]>());
}
}
1 change: 1 addition & 0 deletions src/Stack/Commands/Helpers/Questions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static class Questions
public const string BranchName = "Branch name:";
public const string SelectSourceBranch = "Select a branch to start your stack from:";
public const string ConfirmUpdateStack = "Are you sure you want to update this stack?";
public const string ConfirmSyncStack = "Are you sure you want to sync this stack with the remote repository?";
public const string ConfirmDeleteStack = "Are you sure you want to delete this stack?";
public const string ConfirmDeleteBranches = "Are you sure you want to delete these local branches?";
public const string ConfirmRemoveBranch = "Are you sure you want to remove this branch from the stack?";
Expand Down
15 changes: 11 additions & 4 deletions src/Stack/Commands/Helpers/StackStatusHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,18 @@ public static StackStatus GetStackStatus(
string currentBranch,
IOutputProvider outputProvider,
IGitOperations gitOperations,
IGitHubOperations gitHubOperations)
IGitHubOperations gitHubOperations,
bool includePullRequestStatus = true)
{
var statues = GetStackStatus([stack], currentBranch, outputProvider, gitOperations, gitHubOperations);

return statues[stack];
var statuses = GetStackStatus(
[stack],
currentBranch,
outputProvider,
gitOperations,
gitHubOperations,
includePullRequestStatus);

return statuses[stack];
}

public static void OutputStackStatus(
Expand Down
Loading
Loading