ANDROID: Skip pre-push hook if it doesn't exist. am: 16fb9454bb am: 56a1f7ea9c

Original change: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/3308060

Change-Id: Idbf9f6a15436bffe612277e954bc73f345672e02
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/hooks/install-hooks.sh b/hooks/install-hooks.sh
index d19a3c8..cc5d967 100755
--- a/hooks/install-hooks.sh
+++ b/hooks/install-hooks.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
 
 # Install hooks.
-git config --add hookcmd.check-non-public-commits.command hooks/check-non-public-commits
+git config --add hookcmd.check-non-public-commits.command "[ ! -d hooks ] || hooks/check-non-public-commits"
 git config --add hook.pre-push.command check-non-public-commits
\ No newline at end of file