public async Task <byte[]> ExtractFileFromGit( ILocalRepositoryModel repository, int pullRequestNumber, string sha, string relativePath) { var repo = await GetRepository(repository); try { return(await gitClient.ExtractFileBinary(repo, sha, relativePath)); } catch (FileNotFoundException) { var pullHeadRef = $"refs/pull/{pullRequestNumber}/head"; await gitClient.Fetch(repo, "origin", sha, pullHeadRef); return(await gitClient.ExtractFileBinary(repo, sha, relativePath)); } }