aboutsummaryrefslogtreecommitdiff
path: root/scripts/git
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2019-04-05 18:51:24 +0300
committerrl1987 <rl1987@sdf.lonestar.org>2019-04-05 18:59:48 +0300
commit705c1c28c710b70406712027833ab739729ee583 (patch)
tree865eb993f5edefe612d95316e70bf50a7fdf8043 /scripts/git
parentf021ca2d52da262e14706498190de5fe7859e00b (diff)
downloadtor-705c1c28c710b70406712027833ab739729ee583.tar.gz
tor-705c1c28c710b70406712027833ab739729ee583.zip
Call pre-commit hook from pre-push script
Diffstat (limited to 'scripts/git')
-rwxr-xr-xscripts/git/pre-push.git-hook7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/git/pre-push.git-hook b/scripts/git/pre-push.git-hook
index e7a72efa08..f329829346 100755
--- a/scripts/git/pre-push.git-hook
+++ b/scripts/git/pre-push.git-hook
@@ -27,6 +27,13 @@ ref_is_upstream_branch() {
fi
}
+workdir=$(git rev-parse --show-toplevel)
+if [ -x "$workdir/.git/hooks/pre-commit" ]; then
+ if ! "$workdir"/.git/hooks/pre-commit; then
+ exit 1
+ fi
+fi
+
# shellcheck disable=SC2034
while read -r local_ref local_sha remote_ref remote_sha
do