repo: Make git version check more robust

Change-Id: fc4f7f7408