repository: FetchAll -> RepairMissingRemotes.

BACKPORT: Just add the script, don't hook into it.

Switch to a faster test for the corruption that caused
crbug/921407. This gives some performance improvement, and reduces
network operations, and so reduces GoB flake.

BUG=chromium:925567
TEST=./run_tests

Change-Id: Ib5662080772a50328d6ee7aa3327bf8ea93576e9
Reviewed-on: https://chromium-review.googlesource.com/c/1446600
Tested-by: Don Garrett <dgarrett@chromium.org>
Trybot-Ready: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Lann Martin <lannm@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/1454043
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
diff --git a/scripts/detect_fix_missing_remote.sh b/scripts/detect_fix_missing_remote.sh
new file mode 100755
index 0000000..c65a132
--- /dev/null
+++ b/scripts/detect_fix_missing_remote.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+RESULTS="$(2>&1 >/dev/null git rev-parse --remotes | git cat-file --batch-check)"
+
+if [[ -n "$RESULTS" ]]; then
+    echo "Repairing ${PWD}"
+    git fetch --all
+fi