Index: presubmit_canned_checks.py |
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py |
index 1e0d4c1729597e9c9deb40cc73a0d41801e7da22..90c79ccfcc6deda18a16bed8dfdc65d4848579e4 100644 |
--- a/presubmit_canned_checks.py |
+++ b/presubmit_canned_checks.py |
@@ -643,6 +643,9 @@ def RunPylint(input_api, output_api, white_list=None, black_list=None, |
# Only trigger if there is at least one python file affected. |
def rel_path(regex): |
"""Modifies a regex for a subject to accept paths relative to root.""" |
+ if input_api.os_path.samefile( |
+ input_api.PresubmitLocalPath(), input_api.change.RepositoryRoot()): |
+ return regex |
prefix = input_api.os_path.join(input_api.os_path.relpath( |
input_api.PresubmitLocalPath(), input_api.change.RepositoryRoot()), '') |
return input_api.re.escape(prefix) + regex |