git: do not apply patches on head

Closes #26259.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>