diff options
author | chickenleaf <lashwinib@gmail.com> | 2025-01-14 22:46:51 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-14 17:16:51 +0000 |
commit | d503fd0fbc90b0b424347b2abb5a46845f9a5cab (patch) | |
tree | be98825d94ce9b931aba9bc2e1580da707f43261 /python/servo/testing_commands.py | |
parent | 0e616e0c5d2bef8a6de1df25f2419a435837ed63 (diff) | |
download | servo-d503fd0fbc90b0b424347b2abb5a46845f9a5cab.tar.gz servo-d503fd0fbc90b0b424347b2abb5a46845f9a5cab.zip |
mach: Report an error instead of running `try` with a dirty working directory (#34349)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index ff7ad897723..2c09384dc7f 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -842,6 +842,11 @@ tests/wpt/mozilla/tests for Servo-only tests""" % reference_path) @CommandArgument('try_strings', default=["full"], nargs='...', help="A list of try strings specifying what kind of job to run.") def try_command(self, remote: str, try_strings: list[str]): + if subprocess.check_output(["git", "diff", "--cached", "--name-only"]).strip(): + print("Cannot run `try` with staged and uncommited changes. ") + print("Please either commit or stash them before running `try`.") + return 1 + remote_url = subprocess.check_output(["git", "config", "--get", f"remote.{remote}.url"]).decode().strip() if "github.com" not in remote_url: print(f"The remote provided ({remote_url}) isn't a GitHub remote.") |