Rebase: Extract a method to find base revision Using while(false) with break is unidiomatic in Gerrit. Use early returns from a function instead. Change-Id: Ib188ca5819b0cbe1b111c1ce49b4095fade0f59f