mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 08:34:41 +04:00
Make pre_commit also support pre-push hook
This commit is contained in:
parent
d2b11a0c50
commit
b707cbba06
10 changed files with 227 additions and 42 deletions
12
pre_commit/resources/pre-push-tmpl
Executable file
12
pre_commit/resources/pre-push-tmpl
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
z40=0000000000000000000000000000000000000000
|
||||
while read local_ref local_sha remote_ref remote_sha
|
||||
do
|
||||
if [ "$local_sha" != $z40 ]; then
|
||||
if [ "$remote_sha" = $z40 ];
|
||||
then
|
||||
args="run --all-files"
|
||||
else
|
||||
args="run --origin $local_sha --source $remote_sha"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue