Skip to content

Commit 7b8be70

Browse files
committed
chore: update default branch references from "master" to "main"
1 parent 362a78d commit 7b8be70

File tree

11 files changed

+24
-22
lines changed

11 files changed

+24
-22
lines changed

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
33
"changelog": ["@changesets/changelog-github", { "repo": "okonet/lint-staged" }],
44
"access": "public",
5-
"baseBranch": "master"
5+
"baseBranch": "main"
66
}

.changeset/sour-taxis-buy.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: Security Analysis
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
schedule:
88
- cron: '0 0 * * 1' # 00:00 on Monday.
99
workflow_call:
1010
pull_request:
1111
branches:
12-
- master
12+
- main
1313

1414
jobs:
1515
CodeQL:

.github/workflows/default-branch-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Default Branch Push
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
# Do not run on tags
88
tags-ignore:
99
- '*'

.github/workflows/pull-requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Pull Requests
33
on:
44
pull_request:
55
branches:
6-
- master
6+
- main
77

88
permissions:
99
contents: read

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,15 +909,15 @@ all changed files between two different branches. If you want to run _lint-stage
909909
Try out the `git diff` command until you are satisfied with the result, for example:
910910

911911
```
912-
git diff --diff-filter=ACMR --name-only master...my-branch
912+
git diff --diff-filter=ACMR --name-only main...my-branch
913913
```
914914

915-
This will print a list of _added_, _changed_, _modified_, and _renamed_ files between `master` and `my-branch`.
915+
This will print a list of _added_, _changed_, _modified_, and _renamed_ files between `main` and `my-branch`.
916916

917917
You can then run lint-staged against the same files with:
918918

919919
```
920-
npx lint-staged --diff="master...my-branch"
920+
npx lint-staged --diff="main...my-branch"
921921
```
922922

923923
</details>

test/e2e/no-stash.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ describe('lint-staged', () => {
3131
expect(res.stdout).toMatch('No staged files found.')
3232
expect(res.stderr).toMatch('Skipping backup because `--no-stash` was used.')
3333

34-
res = await lintStaged('--diff=master...my-branch')
34+
res = await lintStaged('--diff=main...my-branch')
3535
expect(res.stderr).toMatch('Skipping backup because `--diff` was used.')
3636

37-
await expect(lintStaged('--diff=master...my-branch --stash')).rejects.toThrow(
37+
await expect(lintStaged('--diff=main...my-branch --stash')).rejects.toThrow(
3838
expect.objectContaining({
3939
stderr: expect.stringContaining('lint-staged failed due to a git error.'),
4040
})
4141
)
4242

43-
res = await lintStaged('--diff=master...my-branch --no-stash')
43+
res = await lintStaged('--diff=main...my-branch --no-stash')
4444
expect(res.stderr).toMatch('Skipping backup because `--diff` was used.')
4545
})
4646
)

test/integration/__utils__/withGitIntegration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const withGitIntegration =
105105
const utils = getGitUtils(cwd)
106106

107107
// Init repository with initial commit
108-
await utils.execGit(['init', '--initial-branch', 'master'])
108+
await utils.execGit(['init', '--initial-branch', 'main'])
109109

110110
if (isWindowsActions()) {
111111
await utils.execGit(['config', 'core.autocrlf', 'input'])

test/integration/merge-conflict.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('lint-staged', () => {
2828

2929
expect(await readFile('test.js')).toEqual(fileInBranchA)
3030

31-
await execGit(['checkout', 'master'])
31+
await execGit(['checkout', 'main'])
3232

3333
// Create another branch
3434
await execGit(['checkout', '-b', 'branch-b'])
@@ -39,7 +39,7 @@ describe('lint-staged', () => {
3939
expect(await readFile('test.js')).toEqual(fileInBranchBFixed)
4040

4141
// Merge first branch
42-
await execGit(['checkout', 'master'])
42+
await execGit(['checkout', 'main'])
4343
await execGit(['merge', 'branch-a'])
4444
expect(await readFile('test.js')).toEqual(fileInBranchA)
4545
expect(await execGit(['log', '-1', '--pretty=%B'])).toMatch('commit a')
@@ -90,7 +90,7 @@ describe('lint-staged', () => {
9090

9191
expect(await readFile('test.js')).toEqual(fileInBranchA)
9292

93-
await execGit(['checkout', 'master'])
93+
await execGit(['checkout', 'main'])
9494

9595
// Create another branch
9696
await execGit(['checkout', '-b', 'branch-b'])
@@ -103,7 +103,7 @@ describe('lint-staged', () => {
103103
expect(await readFile('test.js')).toEqual(fileInBranchBFixed)
104104

105105
// Merge first branch
106-
await execGit(['checkout', 'master'])
106+
await execGit(['checkout', 'main'])
107107
await execGit(['merge', 'branch-a'])
108108
expect(await readFile('test.js')).toEqual(fileInBranchA)
109109
expect(await execGit(['log', '-1', '--pretty=%B'])).toMatch('commit a')
@@ -220,7 +220,7 @@ describe('lint-staged', () => {
220220
await execGit(['commit', '-m', 'Local changes'])
221221

222222
// Initiate merge with conflict
223-
await expect(execGit(['merge', 'master'])).rejects.toThrow('Merge conflict')
223+
await expect(execGit(['merge', 'main'])).rejects.toThrow('Merge conflict')
224224

225225
expect(await execGit(['status', '--porcelain'])).toMatchInlineSnapshot(`
226226
"UU modifiedFileConflictDiscardLocal.js

test/integration/no-initial-commit.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('lint-staged', () => {
1818
await execGit(['add', 'test.js'], { cwd })
1919

2020
await expect(execGit(['log', '-1'], { cwd })).rejects.toThrowErrorMatchingInlineSnapshot(
21-
`"fatal: your current branch 'master' does not have any commits yet"`
21+
`"fatal: your current branch 'main' does not have any commits yet"`
2222
)
2323

2424
expect(await gitCommit({})).toMatch('Skipping backup because there’s no initial commit yet')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy