def _GetGitRevision(self): if not self._git_revision: # Automated tests should always pass the revision, so assume we're on # a workstation and try to get the local origin/master HEAD. if not self._IsLocalRun(): raise RuntimeError( '--git-revision was not passed when running on a bot') revision = repo_utils.GetGitOriginMasterHeadSHA1( host_paths.DIR_SOURCE_ROOT) if not revision or len(revision) != 40: raise RuntimeError( '--git-revision not passed and unable to determine from git' ) self._git_revision = revision return self._git_revision
def _GetGitOriginMasterHeadSha1(): return repo_utils.GetGitOriginMasterHeadSHA1(host_paths.DIR_SOURCE_ROOT)