no-commit-to-branch: Default to both master and main · lircs/pre-commit-hooks@3abbd47 · GitHub
Skip to content

Commit 3abbd47

Browse files
committed
no-commit-to-branch: Default to both master and main
1 parent 51e14fc commit 3abbd47

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion

pre_commit_hooks/no_commit_to_branch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
3838
)
3939
args = parser.parse_args(argv)
4040

41-
protected = frozenset(args.branch or ('master',))
41+
protected = frozenset(args.branch or ('master', 'main'))
4242
patterns = frozenset(args.pattern or ())
4343
return int(is_on_branch(protected, patterns))
4444

tests/no_commit_to_branch_test.py

Lines changed: 7 additions & 0 deletions

0 commit comments

Comments
 (0)