Fix the WPT exporter (#30870)

* Fix the WPT exporter

* apply fixes by @mrobinson

* fix mach test-scripts on NixOS

* rename main_branch_name to default_branch
This commit is contained in:
Delan Azabani 2023-12-15 19:05:00 +08:00 committed by GitHub
parent 29eb4878ed
commit 0be30b30ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 11 deletions

View file

@ -19,6 +19,7 @@ import dataclasses
import json
import logging
import re
import shutil
import subprocess
from typing import Callable, Optional
@ -50,8 +51,12 @@ class LocalGitRepo:
self.path = path
self.sync = sync
# We pass env to subprocess, which may clobber PATH, so we need to find
# git in advance and run the subprocess by its absolute path.
self.git_path = shutil.which("git")
def run_without_encoding(self, *args, env: dict = {}):
command_line = ["git"] + list(args)
command_line = [self.git_path] + list(args)
logging.info(" → Execution (cwd='%s'): %s",
self.path, " ".join(command_line))
@ -142,9 +147,9 @@ class WPTSync:
suppress_force_push: bool = False
def __post_init__(self):
self.servo = GithubRepository(self, self.servo_repo)
self.wpt = GithubRepository(self, self.wpt_repo)
self.downstream_wpt = GithubRepository(self, self.downstream_wpt_repo)
self.servo = GithubRepository(self, self.servo_repo, "main")
self.wpt = GithubRepository(self, self.wpt_repo, "master")
self.downstream_wpt = GithubRepository(self, self.downstream_wpt_repo, "master")
self.local_servo_repo = LocalGitRepo(self.servo_path, self)
self.local_wpt_repo = LocalGitRepo(self.wpt_path, self)