| 56 | ] |
| 57 | |
| 58 | def EnsureGit(v8_path): |
| 59 | def git(args): |
| 60 | # shell=True needed on Windows to resolve git.bat. |
| 61 | return subprocess.check_output( |
| 62 | "git " + args, cwd=v8_path, shell=True).strip() |
| 63 | |
| 64 | expected_git_dir = os.path.join(v8_path, ".git") |
| 65 | actual_git_dir = git("rev-parse --absolute-git-dir") |
| 66 | if expected_git_dir == actual_git_dir: |
| 67 | print("V8 is tracked stand-alone by git.") |
| 68 | return False |
| 69 | print("Initializing temporary git repository in v8.") |
| 70 | git("init") |
| 71 | git("config user.name \"Ada Lovelace\"") |
| 72 | git("config user.email ada@lovela.ce") |
| 73 | git("commit --allow-empty -m init") |
| 74 | return True |
| 75 | |
| 76 | def FetchDeps(v8_path): |
| 77 | # Verify path. |