From d503fd0fbc90b0b424347b2abb5a46845f9a5cab Mon Sep 17 00:00:00 2001 From: chickenleaf Date: Tue, 14 Jan 2025 22:46:51 +0530 Subject: mach: Report an error instead of running `try` with a dirty working directory (#34349) Signed-off-by: L Ashwin B Signed-off-by: Martin Robinson --- python/servo/testing_commands.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/servo/testing_commands.py') 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.") -- cgit v1.2.3