@CheckForNull
  @Override
  public Set<Path> branchChangedFiles(String targetBranchName, Path rootBaseDir) {
    return Optional.ofNullable((branchChangedFilesWithFileMovementDetection(targetBranchName, rootBaseDir)))
      .map(GitScmProvider::extractAbsoluteFilePaths)
      .orElse(null);
  }
@Test
  public void branchChangedFiles_should_not_crash_if_branches_have_no_common_ancestors() throws GitAPIException, IOException {
    String fileName = "file-in-first-commit.xoo";
    String renamedName = "file-renamed.xoo";
    git.checkout().setOrphan(true).setName("b1").call();

    Path file = worktree.resolve(fileName);
    Path renamed = file.resolveSibling(renamedName);
    addLineToFile(fileName, 1);

    Files.move(file, renamed);
    git.rm().addFilepattern(fileName).call();
    commit(renamedName);

    Set<Path> files = newScmProvider().branchChangedFiles("main", worktree);

    // no shared history, so no diff
    assertThat(files).isNull();
  }