NEW293932
export-w3c-test-changes doesn't need to checkout other local branches
https://bugs.webkit.org/show_bug.cgi?id=293932
Summary export-w3c-test-changes doesn't need to checkout other local branches
Sam Sneddon [:gsnedders]
Reported 2025-06-02 17:39:20 PDT
``` gsnedders@gsnedders-margot OS3 % ./Tools/Scripts/export-w3c-test-changes -c -g f456176 -b 279200 -d ~/projects/wpt/wpt-export -n gsnedders Fetching web-platform-tests repository Cleaning web-platform-tests master branch Traceback (most recent call last): File "/Volumes/gsnedders/projects/Safari/OS3/./Tools/Scripts/export-w3c-test-changes", line 35, in <module> sys.exit(test_exporter.main(sys.argv[1:], sys.stdout, sys.stderr)) File "/Volumes/gsnedders/projects/Safari/OS3/Tools/Scripts/webkitpy/w3c/test_exporter.py", line 479, in main test_exporter.do_export() File "/Volumes/gsnedders/projects/Safari/OS3/Tools/Scripts/webkitpy/w3c/test_exporter.py", line 378, in do_export self.clean() File "/Volumes/gsnedders/projects/Safari/OS3/Tools/Scripts/webkitpy/w3c/test_exporter.py", line 289, in clean self._git.checkout('master') File "/Volumes/gsnedders/projects/Safari/OS3/Tools/Scripts/webkitpy/common/checkout/scm/git.py", line 557, in checkout return self._run_git(command) File "/Volumes/gsnedders/projects/Safari/OS3/Tools/Scripts/webkitpy/common/checkout/scm/git.py", line 76, in _run_git return self.run(full_command_args, **full_kwargs) File "/Volumes/gsnedders/projects/Safari/OS3/Tools/Scripts/webkitpy/common/checkout/scm/scm.py", line 73, in run return self._executive.run_command(args, File "/Volumes/gsnedders/projects/Safari/OS3/Tools/Scripts/webkitpy/common/system/executive.py", line 425, in run_command (error_handler or self.default_error_handler)(script_error) File "/Volumes/gsnedders/projects/Safari/OS3/Tools/Scripts/webkitpy/common/system/abstractexecutive.py", line 98, in default_error_handler raise error webkitpy.common.system.executive.ScriptError: Failed to run "['git', 'checkout', 'master']" exit_code: 128 cwd: /Volumes/gsnedders/projects/wpt/wpt-export gsnedders@gsnedders-margot OS3 % git -C /Volumes/gsnedders/projects/wpt/wpt-export checkout master fatal: 'master' is already checked out at '/Volumes/gsnedders/projects/wpt/web-platform-tests' ``` But we don't actually need to checkout `master` before anything else — we just need to make sure we have the HEAD, index, and working tree in a state that matches the default branch. We could just do something like `git switch -d origin/master` — this also has the advantage of not running `git reset --hard` and destroying any state the user already has in their repo, as it will instead cause an error.
Attachments
Radar WebKit Bug Importer
Comment 1 2025-06-02 17:39:27 PDT
Note You need to log in before you can comment on or make changes to this bug.