Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PRESUBMIT_test.py lookup when inherit-review-settings-ok is applied.
When `git cl presubmit` is executed from a nested repository which contains `inherit-review-settings-ok` file, PRESUBMIT_test.py lookup is made via LocalPath() which doesn't include input_api.RepositoryRoot() into account. In this case `full_path` is pointing directly at input_api.PresubmitLocalPath() which leads to PRESUBMIT_test.py being run from a root directory instead of a nested one where a modified PRESUBMIT.py is actually located. Reproduce case: 1. cd third_party/pdfium 2. create inherit-review-settings-ok file 3. run git cl presubmit --force -v --files PRESUBMIT.py Without this patch this is printed: vpython3.bat c:\src\chromium\src\PRESUBMIT_test.py With this patch this is printed: vpython3.bat c:\src\chromium\src\third_party\pdfium\PRESUBMIT_test.py This CL changes the way PRESUBMIT_test.py is located by using absolute path instead; the CL also improves the way PRESUBMIT.py files are found in the change. Change-Id: I9e321ae0693242a9f3bdee94484da282d570954b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3679163 Reviewed-by: Bruce Dawson <brucedawson@chromium.org> Auto-Submit: Aleksey Khoroshilov <akhoroshilov@brave.com> Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Cr-Commit-Position: refs/heads/main@{#1013502}
- Loading branch information