diff options
| author | bors <bors@rust-lang.org> | 2020-10-08 03:58:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-08 03:58:55 +0000 |
| commit | cc662cd4540c6d3b8cb14cf535fa023699503dff (patch) | |
| tree | 70a99b322507cc9089c4fb2f0225c4d39834c61f /src | |
| parent | d9985fc1081849532546d74c35a276694833c09d (diff) | |
| parent | f4989494bf21636763ba3ad5f9181c363b399257 (diff) | |
| download | rust-cc662cd4540c6d3b8cb14cf535fa023699503dff.tar.gz rust-cc662cd4540c6d3b8cb14cf535fa023699503dff.zip | |
Auto merge of #77683 - jyn514:git-hook, r=Mark-Simulacrum
Unset GIT_DIR in pre-commit hook Works around https://github.com/rust-lang/rust/issues/77620. This won't help any other hooks you write manually, but hopefully people won't feel the need to do that now there's an 'official' one. r? `@Mark-Simulacrum` cc `@caass`
Diffstat (limited to 'src')
| -rwxr-xr-x | src/etc/pre-commit.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/etc/pre-commit.sh b/src/etc/pre-commit.sh index 5c5922a7e63..70b4e9d9908 100755 --- a/src/etc/pre-commit.sh +++ b/src/etc/pre-commit.sh @@ -7,15 +7,17 @@ set -Eeuo pipefail -ROOT_DIR="$(git rev-parse --show-toplevel)"; -COMMAND="$ROOT_DIR/x.py test tidy --bless"; +# https://github.com/rust-lang/rust/issues/77620#issuecomment-705144570 +unset GIT_DIR +ROOT_DIR="$(git rev-parse --show-toplevel)" +COMMAND="$ROOT_DIR/x.py test tidy --bless" if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then COMMAND="python $COMMAND" fi -echo "Running pre-commit script '$COMMAND'"; +echo "Running pre-commit script '$COMMAND'" cd "$ROOT_DIR" -$COMMAND; +$COMMAND |
