From d3b2548e57c01853cde9ca3858a3ccb1d9a8bd71 Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Fri, 13 Oct 2017 16:06:25 -0400 Subject: [PATCH] Fix CheckPatchFormatted() error message when using inherit-review-settings-ok Follow-up to d86c80371561676c85680e80962733087607e1a3. The error message was still saying "src" rather than the repository root. Bug: 768962 Change-Id: I781191e561db889a28acf51ee49a20d6d352b489 Reviewed-on: https://chromium-review.googlesource.com/719718 Reviewed-by: Dirk Pranke Commit-Queue: agrieve --- presubmit_canned_checks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 328d1ef19..c71bc3113 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -1103,7 +1103,10 @@ def CheckPatchFormatted(input_api, output_api, check_js=False): cmd.append(input_api.PresubmitLocalPath()) code, _ = git_cl.RunGitWithCode(cmd, suppress_stderr=True) if code == 2: - short_path = input_api.basename(input_api.PresubmitLocalPath()) + if presubmit_subdir: + short_path = presubmit_subdir + else: + short_path = input_api.basename(input_api.change.RepositoryRoot()) return [output_api.PresubmitPromptWarning( 'The %s directory requires source formatting. ' 'Please run: git cl format %s%s' %