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 execution_on_windows_is_disabled_if_git_not_on_path() {
    System2 system2 = mock(System2.class);
    when(system2.isOsWindows()).thenReturn(true);
    when(system2.property("PATH")).thenReturn("C:\\some-path;C:\\some-another-path");

    ProcessWrapperFactory mockFactory = mock(ProcessWrapperFactory.class);
    mockGitWhereOnWindows(mockFactory);

    NativeGitBlameCommand blameCommand = new NativeGitBlameCommand(system2, mockFactory);
    assertThat(blameCommand.checkIfEnabled()).isFalse();
  }