public boolean checkIfEnabled() {
    try {
      this.gitCommand = locateDefaultGit();
      MutableString stdOut = new MutableString();
      this.processWrapperFactory.create(null, l -> stdOut.string = l, gitCommand, "--version").execute();
      return stdOut.string != null && stdOut.string.startsWith("git version") && isCompatibleGitVersion(stdOut.string);
    } catch (Exception e) {
      LOG.debug("Failed to find git native client", e);
      return false;
    }
  }
@Test
  public void git_should_be_enabled_if_version_is_equal_or_greater_than_required_minimum() {
    Stream.of(
      "git version 2.24.0",
      "git version 2.25.2.1",
      "git version 2.24.1.1.windows.2",
      "git version 2.25.1.msysgit.2"
    ).forEach(output -> {
      ProcessWrapperFactory mockedCmd = mockGitVersionCommand(output);
      mockGitWhereOnWindows(mockedCmd);
      when(mockedCmd.create(isNull(), any(), eq("C:\\mockGit.exe"), eq("--version"))).then(invocation -> {
        var argument = (Consumer<String>) invocation.getArgument(1);
        argument.accept(output);
        return mock(ProcessWrapper.class);
      });

      NativeGitBlameCommand blameCommand = new NativeGitBlameCommand(System2.INSTANCE, mockedCmd);
      assertThat(blameCommand.checkIfEnabled()).isTrue();
    });
  }