Akira Ajisaka thank you for the comment. The current script is re-exec'ed if any files under test-patch.d are changed, because pattern "dev-support/test-patch" matches dev-support/test-patch.d/*.
I think the description of this function is inaccurate. It says "If this patches actually patches test-patch.sh, then ...", but not only test-patch.sh, test-patch.d and smart-apply-patch.sh are also included. So I'll fix it.