Refactor if: nesting in build_mirror

Change-Id: Ia0fe43e1f44704d5d93235ceadfcf74d00aa190b
Refactor calls to Git

All pip/virtialenv calls can be refactored in the very same way.

Change-Id: I948546d12ccca0298af012c2d3dac39481049c88