@Test
public void return_early_when_shallow_clone_detected() throws IOException {

  File projectDir = temp.newFolder();
  javaUnzip(new File("test-repos/shallow-git.zip"), projectDir);
  File baseDir = new File(projectDir, "shallow-git");
  DefaultFileSystem fs = new DefaultFileSystem(baseDir);
  when(input.fileSystem()).thenReturn(fs);
  DefaultInputFile inputFile = new TestInputFileBuilder("foo", DUMMY_JAVA).build();
  when(input.filesToBlame()).thenReturn(Collections.singleton(inputFile));
  // register warning with default wrapper
  AnalysisWarnings analysisWarnings = mock(AnalysisWarnings.class);
  JGitBlameCommand jGitBlameCommand = new JGitBlameCommand(new PathResolver(), analysisWarnings);
  BlameOutput output = mock(BlameOutput.class);
  jGitBlameCommand.blame(input, output);
  assertThat(logTester.logs()).first()
    .matches(s -> s.contains("Shallow clone detected, no blame information will be provided."));
  verifyZeroInteractions(output);
  verify(analysisWarnings).addUnique(startsWith("Shallow clone detected"));
}