gclient: Make smoke tests use local dir instead of git daemon.
Running gclient_smoketests times out on windows when using git daemon,
so use a local directory as remote instead.
Bug: 1024683
Change-Id: I6ca506d74de463d914317f176eefbe74996298c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1879723
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
diff --git a/git_cache.py b/git_cache.py
index bad09e9..f104a9b 100755
--- a/git_cache.py
+++ b/git_cache.py
@@ -267,14 +267,13 @@
@staticmethod
def UrlToCacheDir(url):
"""Convert a git url to a normalized form for the cache dir path."""
+ if os.path.isdir(url):
+ # Ignore the drive letter in Windows
+ url = os.path.splitdrive(url)[1]
+ return url.replace('-', '--').replace(os.sep, '-')
+
parsed = urlparse.urlparse(url)
- # Get rid of the port. This is only needed for Windows tests, since tests
- # serve git from git://localhost:port/git, but Windows doesn't like ':' in
- # paths.
- netloc = parsed.netloc
- if ':' in netloc:
- netloc = netloc.split(':', 1)[0]
- norm_url = netloc + parsed.path
+ norm_url = parsed.netloc + parsed.path
if norm_url.endswith('.git'):
norm_url = norm_url[:-len('.git')]