diff --git a/dev/devcam/hook.go b/dev/devcam/hook.go index 0e5b7b7bf..4da9a7a7f 100644 --- a/dev/devcam/hook.go +++ b/dev/devcam/hook.go @@ -112,7 +112,9 @@ func (c *hookCmd) RunCommand(args []string) error { switch args[0] { case "pre-commit": if err := c.hookPreCommit(args[1:]); err != nil { - printf("You can override these checks with 'git commit --no-verify'\n") + if !(len(args) > 1 && args[1] == "test") { + printf("You can override these checks with 'git commit --no-verify'\n") + } cmdmain.ExitWithFailure = true return err } diff --git a/dev/devcam/test.go b/dev/devcam/test.go index da85cb74c..3f956dc46 100644 --- a/dev/devcam/test.go +++ b/dev/devcam/test.go @@ -45,7 +45,7 @@ func init() { cmdmain.RegisterCommand("test", func(flags *flag.FlagSet) cmdmain.CommandRunner { cmd := new(testCmd) flags.BoolVar(&cmd.short, "short", false, "Use '-short' with go test.") - flags.BoolVar(&cmd.precommit, "precommit", true, "Run misc/pre-commit.githook as part of tests.") + flags.BoolVar(&cmd.precommit, "precommit", true, "Run the pre-commit githook as part of tests.") flags.BoolVar(&cmd.verbose, "v", false, "Use '-v' (for verbose) with go test.") flags.StringVar(&cmd.run, "run", "", "Use '-run' with go test.") return cmd @@ -158,7 +158,7 @@ func (c *testCmd) runTests(args []string) error { } func (c *testCmd) runPrecommitHook() error { - out, err := exec.Command(filepath.FromSlash("./misc/pre-commit.githook"), "test").CombinedOutput() + out, err := exec.Command(filepath.FromSlash("./bin/devcam"), "hook", "pre-commit", "test").CombinedOutput() if err != nil { fmt.Println(string(out)) }