diff --git a/cmd/run.go b/cmd/run.go index 5f52188a..5f3ec271 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -69,6 +69,11 @@ func (run) New(opts *lefthook.Options) *cobra.Command { "skip updating git hooks", ) + runCmd.Flags().BoolVar( + &runArgs.NoLFS, "no-lfs", false, + "skip running git lfs", + ) + runCmd.Flags().BoolVar( &runArgs.FilesFromStdin, "files-from-stdin", false, "get files from standard input, null-separated", diff --git a/internal/lefthook/run.go b/internal/lefthook/run.go index 5ab91f1c..e5f2d0f2 100644 --- a/internal/lefthook/run.go +++ b/internal/lefthook/run.go @@ -27,6 +27,7 @@ type RunArgs struct { FilesFromStdin bool Force bool NoAutoInstall bool + NoLFS bool Files []string RunOnlyCommands []string } @@ -162,7 +163,7 @@ func (l *Lefthook) Run(hookName string, args RunArgs, gitArgs []string) error { GitArgs: gitArgs, LogSettings: logSettings, DisableTTY: cfg.NoTTY || args.NoTTY, - DisableLFS: cfg.SkipLFS, + DisableLFS: cfg.SkipLFS || args.NoLFS, Files: args.Files, Force: args.Force, RunOnlyCommands: args.RunOnlyCommands,