@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 blame_on_nested_module(BlameAlgorithmEnum strategy) throws IOException {
    CompositeBlameCommand blameCommand = new CompositeBlameCommand(analysisWarnings, pathResolver, jGitBlameCommand, nativeGitBlameCommand, (p, f) -> strategy);
    File projectDir = createNewTempFolder();
    javaUnzip("dummy-git-nested.zip", projectDir);
    File baseDir = new File(projectDir, "dummy-git-nested/dummy-project");
    DefaultFileSystem fs = new DefaultFileSystem(baseDir);
    when(input.fileSystem()).thenReturn(fs);
    DefaultInputFile inputFile = new TestInputFileBuilder("foo", DUMMY_JAVA)
      .setModuleBaseDir(baseDir.toPath())
      .build();
    fs.add(inputFile);

    BlameCommand.BlameOutput blameResult = mock(BlameCommand.BlameOutput.class);
    when(input.filesToBlame()).thenReturn(List.of(inputFile));
    blameCommand.blame(input, blameResult);

    Date revisionDate = DateUtils.parseDateTime("2012-07-17T16:12:48+0200");
    String revision = "6b3aab35a3ea32c1636fee56f996e677653c48ea";
    String author = "david@gageot.net";
    verify(blameResult).blameResult(inputFile,
      IntStream.range(0, 26)
        .mapToObj(i -> new BlameLine().revision(revision).date(revisionDate).author(author))
        .collect(Collectors.toList()));
  }