0
0
mirror of https://github.com/thegeeklab/git-sv.git synced 2024-11-25 07:30:38 +00:00

fix(validate-commit-message): ignore validation when source is merge

issue: #11
This commit is contained in:
Beatriz Vieira 2021-02-25 21:22:28 -03:00
parent 16da636d96
commit 29594212f3
2 changed files with 6 additions and 1 deletions

View File

@ -376,6 +376,11 @@ func validateCommitMessageHandler(git sv.Git, messageProcessor sv.MessageProcess
return nil 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")) filepath := filepath.Join(c.String("path"), c.String("file"))
commitMessage, err := readFile(filepath) commitMessage, err := readFile(filepath)

View File

@ -144,7 +144,7 @@ func main() {
{ {
Name: "validate-commit-message", Name: "validate-commit-message",
Aliases: []string{"vcm"}, 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), Action: validateCommitMessageHandler(git, messageProcessor),
Flags: []cli.Flag{ Flags: []cli.Flag{
&cli.StringFlag{Name: "path", Required: true, Usage: "git working directory"}, &cli.StringFlag{Name: "path", Required: true, Usage: "git working directory"},