#54741: build: skip patch targets that are not checked out
Description of Change
script/apply_all_patches.py only checked os.path.exists(repo) before running git am. A DEPS entry that gclient does not fetch (for example src/third_party/fontconfig/src, which has condition: 'checkout_linux' and is therefore skipped on Windows and macOS) still exists as an empty directory, because Chromium tracks it as a gitlink. The check passed, and git -C <empty dir> resolved to the parent Chromium repo.
Patches meant for the unfetched repo were then applied to src at the same time as the Chromium patches, and git am failed with previous rebase directory .git/rebase-apply still exists but mbox given. update-ref also moved refs/patches/upstream-head in src to the wrong commit.
The check now requires <repo>/.git, so targets that were not checked out are skipped with the existing repo not found warning.
Checklist
- I have filled out the PR description
- I have reviewed and verified the changes
- I have built and tested this change
Release Notes
Notes: none
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron