Use the same git-cache bucket for authenticated and unauthenticated repos.
We should only be maintaining one cache bundle per repo, but it turns
out that we've had two in the past due to GoB supporting two different
paths to the repo, and users were getting stale bundles as a result.
This CL fixes things so that we should only get a single bundle per
repo.
Bug: 935084
Change-Id: I0d6713280a2abbc20e35ff87e7be115870dd5140
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1566431
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
diff --git a/git_cache.py b/git_cache.py
index f17f466..4e67767 100755
--- a/git_cache.py
+++ b/git_cache.py
@@ -264,6 +264,10 @@
norm_url = parsed.netloc + parsed.path
if norm_url.endswith('.git'):
norm_url = norm_url[:-len('.git')]
+
+ # Use the same dir for authenticated URLs and unauthenticated URLs.
+ norm_url = norm_url.replace('googlesource.com/a/', 'googlesource.com/')
+
return norm_url.replace('-', '--').replace('/', '-').lower()
@staticmethod