and two lines after the clone is reset to the revision specified in GIT_REV and then the custom patches are applied
Ah, yes, indeed. Thanks! It's the first time I see this reset command. I was expecting to clone a specific version, rather than resetting.
And the fact that the patches when applied, had a message kind of "succedded on the next line" (sorry not the exact message) made me suspect it was applied to a different version.