Get rev from repo not dir.

In cases where a PR was merged the git rev for the root dir comes from the initial commit not the merge. This leads to multiple revs being used in different cases and breaks downstream builds.