diff --git a/remote_branch_checker/remote_branch_checker.sh b/remote_branch_checker/remote_branch_checker.sh index c64a190..f13aae7 100755 --- a/remote_branch_checker/remote_branch_checker.sh +++ b/remote_branch_checker/remote_branch_checker.sh @@ -318,9 +318,16 @@ sed '/^$/d' ${WORKSPACE}/work/patchset.files > ${WORKSPACE}/work/patchset.files. mv ${WORKSPACE}/work/patchset.files.tmp ${WORKSPACE}/work/patchset.files # For 4.5 and up, verify that the we aren't modifying any upgrade.txt or UPGRADING.md files. +# lib/guzzlehttp/guzzle/UPGRADING.md is a false positive. It's a vendored file. if [[ ${versionbranch} -ge 405 ]]; then - if grep -q 'UPGRADING.md\|upgrade.txt' ${WORKSPACE}/work/patchset.files; then + if sed '/lib\/guzzlehttp\/guzzle\/UPGRADING.md/d' ${WORKSPACE}/work/patchset.files | grep -q 'UPGRADING.md\|upgrade.txt'; then echo "Error: The patchset contains changes to upgrade.txt or UPGRADING.md files." | tee -a ${errorfile} + + dirtyupgrades="$( sed '/lib\/guzzlehttp\/guzzle\/UPGRADING.md/d' ${WORKSPACE}/work/patchset.files | grep 'UPGRADING.md\|upgrade.txt' )" + if [[ -n "${dirtyupgrades}" ]]; then + echo "Error: File(s) affected:" | tee -a ${errorfile} + echo "${dirtyupgrades}" | sed "/^${WORKSPACE}//g" | sed 's/^/Error: /' | tee -a ${errorfile} + fi fi fi diff --git a/tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_405.regex b/tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_405.regex index 563714d..14ea503 100644 --- a/tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_405.regex +++ b/tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_405.regex @@ -5,3 +5,8 @@ condensedresult="smurf,error,1,0:overview,error,1,0 The patchset contains changes to upgrade.txt or UPGRADING.md files. +File(s) affected: +UPGRADING.md +lib/upgrade.txt +mod/assign/UPGRADING.md +mod/assign/upgrade.txt