diff --git a/internal/lefthook/runner/runner.go b/internal/lefthook/runner/runner.go index 296a3ba5..13977fb7 100644 --- a/internal/lefthook/runner/runner.go +++ b/internal/lefthook/runner/runner.go @@ -288,12 +288,7 @@ func (r *Runner) buildCommandArgs(command *config.Command) ([]string, error) { filesCommand != "" && filesType == config.SubFiles { files, err := filesFn() if err != nil { - var gitErr error - if filesType == config.SubFiles { - gitErr = fmt.Errorf("error running '%s': %s", filesCommand, err) - } else { - gitErr = fmt.Errorf("error replacing %s: %s", filesType, err) - } + gitErr := fmt.Errorf("error replacing %s: %s", filesType, err) return nil, gitErr } if len(files) == 0 {