The land-patch.sh script suffers from a poor design that makes it
not only difficult to test, but also difficult to compose into parts for reuse.
This is made most evident when attempting to modify land-patch.sh to support
automated workflows that produce git commits only rather than revisions.
The first step to improving the design is extracting out this critical security
piece so that it can be leverged in multiple places. It also adds test coverage.
This patch does not modify behavior.