GitCommandResult (final @Nullable Project project, final @NotNull File parentDirectory, final @NotNull String url, final @NotNull String clonedDirectoryName, final GitLineHandlerListener @NotNull ... listeners) { return runCommand(() -> { // do not use per-project executable for 'clone' command Project defaultProject = ProjectManager.getInstance().getDefaultProject(); GitExecutable executable = GitExecutableManager.getInstance().getExecutable(defaultProject, parentDirectory); GitLineHandler handler = new GitLineHandler(defaultProject, parentDirectory, executable, GitCommand.CLONE, emptyList()); handler.setSilent(false); handler.setStderrSuppressed(false); handler.setUrl(url); handler.addParameters("--progress"); if (GitVersionSpecialty.CLONE_RECURSE_SUBMODULES.existsIn(project, handler.getExecutable()) && AdvancedSettings.getBoolean("git.clone.recurse.submodules")) { handler.addParameters("--recurse-submodules"); } handler.addParameters(url); handler.endOptions(); handler.addParameters(clonedDirectoryName); addListeners(handler, listeners); return handler; }); }