forge
Explore
Log in

Don't you dare go Hollow

cargo runner: find memguard-runner.sh without .git

Browse files at this commit

6bdd1416ea7e945fefdc64ab48d8c88e8d8f3ce4Ahmet Kaan GümüşParent: b7434a2
cargo-mutants scratch copies and remote-run rsyncs have no .git, so
`git rev-parse` failed and the test runner never started. Fall back to
walking up from the cwd.
.cargo/config.tomlmodified+4 -2
@@ -5,8 +5,10 @@
5 # (cargo does not resolve runner paths relative to this file, and an absolute5 # (cargo does not resolve runner paths relative to this file, and an absolute
6 # path would break other worktree checkouts of this repo). `git bisect run`6 # path would break other worktree checkouts of this repo). `git bisect run`
7 # exports GIT_DIR, which would make that rev-parse resolve the test package7 # exports GIT_DIR, which would make that rev-parse resolve the test package
8-# dir instead of the repo. Strip the leaked git vars first.8+# dir instead of the repo. Strip the leaked git vars first. Trees without
9-runner = ["bash", "-c", "root=$(env -u GIT_DIR -u GIT_WORK_TREE -u GIT_INDEX_FILE git rev-parse --show-toplevel) && exec \"$root/scripts/memguard-runner.sh\" \"$@\"", "--"]9+# .git (cargo-mutants scratch copies, remote-run rsyncs) walk up from the cwd to
10+# the first dir holding the runner instead.
11+runner = ["bash", "-c", "root=$(env -u GIT_DIR -u GIT_WORK_TREE -u GIT_INDEX_FILE git rev-parse --show-toplevel 2>/dev/null) || { root=$PWD; while [ \"$root\" != / ] && [ ! -x \"$root/scripts/memguard-runner.sh\" ]; do root=$(dirname \"$root\"); done; }; exec \"$root/scripts/memguard-runner.sh\" \"$@\"", "--"]
10 12
11 [env]13 [env]
12 # The AV1 rate-target tests keep several frames' worth of encoder state on the14 # The AV1 rate-target tests keep several frames' worth of encoder state on the