Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ReplaceBranch hook to avoid running on
--amend
by default (#725
) * change default branch pattern for ReplaceBranch This changes the default branch pattern to a simpler pattern. This is added to make understanding the hook and it's usage a bit easier. * change an example in ReplaceBranch spec to default This changes the spec to test against the same default branch replacement pattern specified in the default config. This is just to make things more consistent. * improve class comment describing ReplaceBranch usage This makes the usage of this (hopefully) obvious to anyone reading it. * add `commit` to default ReplaceBranch skipped types This makes the default behavior of this hook skip commits that explicitly give the SHA, i.e, `--amend`, `-c`, or `-C`. This is added because most people (I'd argue) don't want to run this hook on `amend`s. * remove extra hard-coded space in ReplaceBranch This removes a trailing space after the repacement text, as well as `#strip`ing the replacement text. * refactor ReplaceBranch specs to avoid so much mocking This changes the specs for the ReplaceBranch hook to - test the contents of the file that `git` writes it's commit message to - explicitly set config variables instead of mocking them * update ReplaceBranch specs to test all `skipped_commit_types` * shorten a long line for the linter
- Loading branch information
1 parent
0491737
commit 603aa1b
Showing
3 changed files
with
138 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters