diff --git a/infra/k8s/argo/lob-backtest-sweep-template.yaml b/infra/k8s/argo/lob-backtest-sweep-template.yaml index b571b2cb0..71573053f 100644 --- a/infra/k8s/argo/lob-backtest-sweep-template.yaml +++ b/infra/k8s/argo/lob-backtest-sweep-template.yaml @@ -216,7 +216,13 @@ spec: echo "=== Cache MISS: compiling fxt-backtest for $SHORT_SHA ===" if [ -d "$BUILD/.git" ]; then - cd "$BUILD"; git fetch origin; git checkout "$SHA" + # Same pattern as alpha-perception-template.yaml: prior + # cargo build mutates Cargo.lock (and sometimes other + # generated files); --force checkout overwrites them, + # `git clean -fd` drops untracked. Without this, the + # second SHA's checkout fails on dirty working tree. + cd "$BUILD"; git fetch origin + git checkout --force "$SHA"; git clean -fd else git clone --filter=blob:none "$REPO" "$BUILD" cd "$BUILD"; git checkout "$SHA"