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
experimental/szager/collated-output
nsylvain@chromium.org 14 years ago
parent 4c6e404cf9
commit 328c3c73a8

@ -493,6 +493,12 @@ class GitWrapper(SCMWrapper):
clone_cmd.append('--verbose') clone_cmd.append('--verbose')
clone_cmd.extend([url, self.checkout_path]) 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): for _ in range(3):
try: try:
self._Run(clone_cmd, options, cwd=self._root_dir) self._Run(clone_cmd, options, cwd=self._root_dir)

Loading…
Cancel
Save