Commit 328c3c73 authored by nsylvain@chromium.org's avatar nsylvain@chromium.org

Workaround a git clone bug on Windows.

On Windows "git clone url path/repo" does not create 'path' if it does
not exist. It fails with:

Fatal: could not create work tree dir 'path\repo'.: No such file or directory

this patch manually creates the subdir if it does not exist.
Review URL: http://codereview.chromium.org/7080063

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@87522 0039d316-1c4b-4281-b951-d872f2087c98
parent 4c6e404c
......@@ -493,6 +493,12 @@ class GitWrapper(SCMWrapper):
clone_cmd.append('--verbose')
clone_cmd.extend([url, self.checkout_path])
# If the parent directory does not exist, Git clone on Windows will not
# create it, so we need to do it manually.
parent_dir = os.path.dirname(self.checkout_path)
if not os.path.exists(parent_dir):
os.makedirs(parent_dir)
for _ in range(3):
try:
self._Run(clone_cmd, options, cwd=self._root_dir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment