hooks:pre-commit: Explicitly propagate pipe error
The `die` in the pipe does not exit the whole script but only the pipe. This currently works because the pipe is the last thing being executed. If something would come after the pipe, the hook would happily continue executing. Properly propagate the exit to prevent this in the future.
This commit is contained in:
@@ -62,4 +62,4 @@ git diff --staged --name-only --diff-filter=AT $against \
|
||||
fi
|
||||
done
|
||||
[ "$abort" -eq 0 ] || die
|
||||
}
|
||||
} || exit
|
||||
|
||||
Reference in New Issue
Block a user