ANDROID: Skip pre-push hook if it doesn't exist.

Since the hooks only exist for aosp and not upstream, check whether the
hooks directory exists before running, and trivially succeed in that
case.

Test: `git push -n $gitlab-remote` in branch tracking aosp/main
Test: `git push -n $gitlab-remote` in branch tracking upstream
Bug: 371583224

Change-Id: I2060a85a19aa1008a3b372e17d0fb8e463d737aa
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