Skip to content

Commit c425a94

Browse files
committed
feat(output): display number of merged branches
1 parent 6885a79 commit c425a94

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Example output:
3333

3434
```bash
3535
$ git-merged-branches
36-
Branches merged into 'master':
36+
3 branches merged into 'master':
3737
bugfix/fix-crash-on-start
3838
feature/add-new-feature
3939
hotfix/urgent-fix
@@ -59,7 +59,7 @@ With this setup, `git-merged-branches` will generate links for branches with suc
5959

6060
```bash
6161
$ git-merged-branches
62-
Branches merged into 'master':
62+
4 branches merged into 'master':
6363
fix/EXTERNAL-391
6464
fix/TOKEN-123_some-fix <https://your-jira-instance.net/browse/TOKEN-123>
6565
hotfix

src/output.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function outputMergedBranches(branches: string[], targetBranch: string, c
3939
return console.info(`No branches merged into '${targetBranch}'.`);
4040
}
4141

42-
console.info(`Branches merged into '${targetBranch}':`)
42+
console.info(`${branches.length} branches merged into '${targetBranch}':`)
4343
console.info(formatTaskBranches(branches, config).join("\n"));
4444

4545
const remoteBranches = fetchRemoteBranches("origin");

src/tests/output.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe("outputMergedBranches", () => {
7777
const branches = ["feat/TOKEN-800_new-feature", "fix/TOKEN-123_some-fix"];
7878

7979
outputMergedBranches(branches, "master", DEFAULT_CONFIG);
80-
expect(infoSpy).toHaveBeenNthCalledWith(1, "Branches merged into 'master':");
80+
expect(infoSpy).toHaveBeenNthCalledWith(1, "2 branches merged into 'master':");
8181
const branchOutput = [
8282
"feat/TOKEN-800_new-feature <https://test-instance.org/browse/TOKEN-800>",
8383
"fix/TOKEN-123_some-fix <https://test-instance.org/browse/TOKEN-123>"
@@ -96,7 +96,7 @@ describe("outputMergedBranches", () => {
9696
vi.spyOn(repoMethods, "fetchRemoteBranches").mockReturnValue(branches);
9797

9898
outputMergedBranches(branches, "master", DEFAULT_CONFIG);
99-
expect(infoSpy).toHaveBeenNthCalledWith(1, "Branches merged into 'master':");
99+
expect(infoSpy).toHaveBeenNthCalledWith(1, "2 branches merged into 'master':");
100100
const branchOutput = [
101101
"feat/TOKEN-800_new-feature <https://test-instance.org/browse/TOKEN-800>",
102102
"fix/TOKEN-123_some-fix <https://test-instance.org/browse/TOKEN-123>"

0 commit comments

Comments
 (0)