Fix populating repo revisions for git repos.

The prior version of the code would get confused by repos outside of
the repo of the current working directory. This patch reworks things
to be much clearer about which repo is being used for which path.

This will allow git-based bots to properly detect the repo revisions
when uploading the results data from run-webkit-tests to the flakiness
dashboard.

R=eseidel@chromium.org
BUG=386775

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

git-svn-id: svn://svn.chromium.org/blink/trunk@176555 bbb929c8-8fbe-4397-9dbb-9b2b20218538