sip: only apply patch to HEAD

Fixes #19919.