Run git commands from inside checkout

This script may be run from outside the mojo checkout, chdir first so
git rev-parse returns the right thing.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/696423002