Disable pre-commit on Windows Pre-commit checks are slow on Windows, and Visual Studio can already enforce the invocation of clang-format. Bug: b/203200623 Change-Id: Ifaf169861ddf5973446b2c2c7626edf59a6cb2de
diff --git a/pre-commit b/pre-commit index d694756..e3760ff 100755 --- a/pre-commit +++ b/pre-commit
@@ -6,6 +6,11 @@ 'If this is unexpected, please file a go/git-bug' >&2 fi +# Do not perform pre-commit on Windows +if [[ "$OSTYPE" == "win32" || "$OSTYPE" == "msys" ]] + exit 0 +fi + # Make a temporary directory TMPDIR=$(mktemp -d -t gcp-$(date +%Y-%m-%d-%H-%M-%S)-XXXXXXXXXX) diffFile=$(mktemp gpc-XXXXXXXXX --tmpdir=$TMPDIR)