mattpolito/paratrooper — pull request #56 by bdmac (2014-04-03 06:08:57+00:00)
Title: Memoize pending migration check git diff

Very basic change to memoize the system call to `git diff` as we would not expect this value to change for the lifetime of a given instance of a PendingMigrationCheck.

The git diff is not very time-consuming but I know when I was writing some callbacks tonight I was worried about the timing of reaching in and checking ```deploy.migration_check.migrations_waiting?```. I expected this value to be memoized somewhere so that callbacks after migrations ran would still have a true value for this method call.

After digging in a bit more of course I realized that the way the git diff is constructed it does not actually matter if the value is memoized but the fact that it was not confused me at first and caused me to dig more than I needed to.

This change would have prevented me from questioning the timeline of making multiple calls to the the PendingMigrationCheck *and* should be a (tiny?) bit more efficient.