@Override
  public void blame(BlameInput input, BlameOutput output) {
    File basedir = input.fileSystem().baseDir();
    try (Repository repo = JGitUtils.buildRepository(basedir.toPath())) {

      File gitBaseDir = repo.getWorkTree();
      if (cloneIsInvalid(gitBaseDir)) {
        return;
      }
      Profiler profiler = Profiler.create(LOG);
      profiler.startDebug("Collecting committed files");
      Map<String, InputFile> inputFileByGitRelativePath = getCommittedFilesToBlame(repo, gitBaseDir, input);
      profiler.stopDebug();

      BlameAlgorithmEnum blameAlgorithmEnum = this.blameStrategy.getBlameAlgorithm(Runtime.getRuntime().availableProcessors(), inputFileByGitRelativePath.size());
      LOG.debug("Using {} strategy to blame files", blameAlgorithmEnum);
      if (blameAlgorithmEnum == GIT_FILES_BLAME) {
        blameWithFilesGitCommand(output, repo, inputFileByGitRelativePath);
      } else {
        blameWithNativeGitCommand(output, repo, inputFileByGitRelativePath, gitBaseDir);
      }
    }
  }
@Test
  @UseDataProvider("blameAlgorithms")
  public void skip_files_not_committed(BlameAlgorithmEnum strategy) throws Exception {
    // skip if git not installed
    if (strategy == GIT_NATIVE_BLAME) {
      assumeTrue(nativeGitBlameCommand.checkIfEnabled());
    }

    JGitBlameCommand jgit = mock(JGitBlameCommand.class);
    BlameCommand blameCmd = new CompositeBlameCommand(analysisWarnings, pathResolver, jgit, nativeGitBlameCommand, (p, f) -> strategy);
    File projectDir = createNewTempFolder();
    javaUnzip("dummy-git.zip", projectDir);

    File baseDir = new File(projectDir, "dummy-git");
    setUpBlameInputWithFile(baseDir.toPath());
    TestBlameOutput output = new TestBlameOutput();
    blameCmd.blame(input, output);
    assertThat(output.blame).hasSize(1);
    assertThat(output.blame.get(input.filesToBlame().iterator().next())).hasSize(29);
  }