commit | ca2b6dc9be5d081553de75cfe818d0f5012eaf89 | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Fri Oct 09 11:29:12 2020 +0200 |
committer | Edwin Kempin <ekempin@google.com> | Mon Oct 12 12:19:49 2020 +0200 |
tree | f61edf6f17c7c4b257c3ff6200414f0c3f0bfc09 | |
parent | 9f76caea2b03e6c15b332cd9c1ee33bd7c93f2d7 [diff] |
CodeOwnerApprovalCheck: Fix exception when no old path is set for deletion For deleted files we expect that that the old path is present and that no new path is set. However for deleted files in merge commits that resolved a conflict between a file modification in the destination branch and a deletion in the source branch, the new path was present and the old path was not set when the comparison was done against the AutoMerge. This caused an IllegalStateException in CodeOwnerApprovalCheck saying "old path must be present for deletion/rename". The reason for this was that PatchListEntry sets the old path as new name and the old name is unset (see PatchListEntry constructor), which is inconsistent with DiffEntry. PatchListEntry is only used when the comparison is done against the AutoMerge which is why we didn't catch this bug with the existing tests for file deletions. To fix this we now get the old path from the new name field in PatchListEntry when we are constructing a ChangedFile instance from a PatchListEntry for a file deletion. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I99fd443317f360456bfe3199ac2819b7b19ff0d7
This plugin provides support for defining code owners for files in a repository.
If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.
Also see resources/Documentation/about.md
IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md