mirror of
https://github.com/thegeeklab/git-sv.git
synced 2024-11-21 12:00:40 +00:00
fix(validate-commit-message): ignore validation when source is merge
issue: #11
This commit is contained in:
parent
16da636d96
commit
29594212f3
@ -376,6 +376,11 @@ func validateCommitMessageHandler(git sv.Git, messageProcessor sv.MessageProcess
|
||||
return nil
|
||||
}
|
||||
|
||||
if source := c.String("source"); source == "merge" {
|
||||
warn("commit message validation skipped, ignoring source: %s...", source)
|
||||
return nil
|
||||
}
|
||||
|
||||
filepath := filepath.Join(c.String("path"), c.String("file"))
|
||||
|
||||
commitMessage, err := readFile(filepath)
|
||||
|
@ -144,7 +144,7 @@ func main() {
|
||||
{
|
||||
Name: "validate-commit-message",
|
||||
Aliases: []string{"vcm"},
|
||||
Usage: "use as prepare-commit-message hook to validate message",
|
||||
Usage: "use as prepare-commit-message hook to validate and enhance commit message",
|
||||
Action: validateCommitMessageHandler(git, messageProcessor),
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{Name: "path", Required: true, Usage: "git working directory"},
|
||||
|
Loading…
Reference in New Issue
Block a user