checkout: Strip all dot slashes from fetch

Bug: 270302297

Change-Id: Iba660b4f66861daf834c942afa4e4d40fb9ed305
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/210391
Reviewed-by: Rob Mohr <mohrr@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Samuel Liu <slliu@google.com>
diff --git a/recipe_modules/checkout/api.py b/recipe_modules/checkout/api.py
index 5c6e7bd..6bf7518 100644
--- a/recipe_modules/checkout/api.py
+++ b/recipe_modules/checkout/api.py
@@ -386,7 +386,7 @@
                     pres.step_summary_text = repr(remote.attrib)
                 remote = Remote(**remote.attrib)
                 if remote.fetch.startswith('..'):
-                    rest = remote.fetch[2:]
+                    rest = re.sub(r'^(..)(/..)*', '', remote.fetch)
                     parsed = urllib.parse.urlparse(manifest_remote)
                     remote.fetch = f'{parsed.scheme}://{parsed.netloc}' + rest
                 remote.fetch = Url(remote.fetch)