Skip to content

Commit 25084b1

Browse files
committed
Fix FetchDeps on windows not finding git.bat
1 parent 787cd03 commit 25084b1

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

deps/v8/tools/node/fetch_deps.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,21 @@
4343
]
4444

4545
def EnsureGit(v8_path):
46+
def git(args):
47+
# shell=True needed on Windows to resolve git.bat.
48+
return subprocess.check_output(
49+
"git " + args, cwd=v8_path, shell=True).strip()
50+
4651
expected_git_dir = os.path.join(v8_path, ".git")
47-
actual_git_dir = subprocess.check_output(
48-
["git", "rev-parse", "--absolute-git-dir"], cwd=v8_path).strip()
52+
actual_git_dir = git("rev-parse --absolute-git-dir")
4953
if expected_git_dir == actual_git_dir:
5054
print "V8 is tracked stand-alone by git."
5155
return False
5256
print "Initializing temporary git repository in v8."
53-
subprocess.check_call(["git", "init"], cwd=v8_path)
54-
subprocess.check_call(["git", "config", "user.name", "\"Ada Lovelace\""], cwd=v8_path)
55-
subprocess.check_call(["git", "config", "user.email", "\"[email protected]\""], cwd=v8_path)
56-
subprocess.check_call(["git", "commit", "--allow-empty", "-m", "init"],
57-
cwd=v8_path)
57+
git("init")
58+
git("config user.name \"Ada Lovelace\"")
59+
git("config user.email [email protected]")
60+
git("commit --allow-empty -m init")
5861
return True
5962

6063
def FetchDeps(v8_path):

deps/v8/tools/node/node_common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# found in the LICENSE file.
55

66
import os
7+
import pipes
78
import shutil
89
import stat
910
import subprocess
@@ -22,7 +23,10 @@ def _Get(v8_path):
2223
pass
2324
if fetch_if_not_exist:
2425
print "Checking out depot_tools."
25-
subprocess.check_call(["git", "clone", DEPOT_TOOLS_URL, depot_tools])
26+
# shell=True needed on Windows to resolve git.bat.
27+
subprocess.check_call("git clone {} {}".format(
28+
pipes.quote(DEPOT_TOOLS_URL),
29+
pipes.quote(depot_tools)), shell=True)
2630
return depot_tools
2731
return None
2832
depot_tools = _Get(v8_path)

0 commit comments

Comments
 (0)