Skip to content

Commit

Permalink
feat: skip LFS hooks when pre-push hook is skipped (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachahn authored Sep 26, 2024
1 parent 6858ccb commit 6383ff3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/lefthook/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ type executable interface {
func (r *Runner) RunAll(ctx context.Context, sourceDirs []string) ([]Result, error) {
results := make([]Result, 0, len(r.Hook.Commands)+len(r.Hook.Scripts))

if err := r.runLFSHook(ctx); err != nil {
return results, err
}

if r.Hook.DoSkip(r.Repo.State()) {
r.logSkip(r.HookName, "hook setting")
return results, nil
}

if err := r.runLFSHook(ctx); err != nil {
return results, err
}

if !r.DisableTTY && !r.Hook.Follow {
log.StartSpinner()
defer log.StopSpinner()
Expand Down

0 comments on commit 6383ff3

Please sign in to comment.