@Test
public void branchChangedFiles_falls_back_to_local_ref_if_origin_branch_does_not_exist_when_running_on_circle_ci() throws IOException, GitAPIException {

  when(system2.envVariable("CIRCLECI")).thenReturn("true");
  git.checkout().setName("b1").setCreateBranch(true).call();
  createAndCommitFile("file-b1");
  Path worktree2 = temp.newFolder().toPath();
  Git local = Git.cloneRepository()
    .setURI(worktree.toString())
    .setDirectory(worktree2.toFile())
    .call();
  local.checkout().setName("local-only").setCreateBranch(true).setStartPoint("origin/master").call();
  local.checkout().setName("b1").call();
  assertThat(newScmProvider().branchChangedFiles("local-only", worktree2))
    .containsOnly(worktree2.resolve("file-b1"));
  verifyZeroInteractions(analysisWarnings);
}