git: do not use mediator while preparing repository in tests

* this speeds up tests on windows agents
This commit is contained in:
Aleksey Pivovarov
2018-03-01 17:53:59 +03:00
parent 8d8abdb98b
commit 4764046b1e
3 changed files with 10 additions and 14 deletions
@@ -48,7 +48,7 @@ public class GitLineHandler extends GitTextHandler {
* Line listeners
*/
private final EventDispatcher<GitLineHandlerListener> myLineListeners = EventDispatcher.create(GitLineHandlerListener.class);
private final boolean myWithMediator;
private boolean myWithMediator = true;
/**
* Remote url which require authentication
@@ -58,29 +58,19 @@ public class GitLineHandler extends GitTextHandler {
public GitLineHandler(@NotNull Project project, @NotNull File directory, @NotNull GitCommand command) {
super(project, directory, command);
myWithMediator = true;
}
public GitLineHandler(@NotNull Project project,
@NotNull VirtualFile vcsRoot,
@NotNull GitCommand command) {
this(project, vcsRoot, command, Collections.emptyList());
super(project, vcsRoot, command);
}
public GitLineHandler(@NotNull Project project,
@NotNull VirtualFile vcsRoot,
@NotNull GitCommand command,
@NotNull List<String> configParameters) {
this(project, vcsRoot, command, configParameters, true);
}
public GitLineHandler(@NotNull Project project,
@NotNull VirtualFile vcsRoot,
@NotNull GitCommand command,
@NotNull List<String> configParameters,
boolean withMediator) {
super(project, vcsRoot, command, configParameters);
myWithMediator = withMediator;
}
public GitLineHandler(@Nullable Project project,
@@ -89,7 +79,6 @@ public class GitLineHandler extends GitTextHandler {
@NotNull GitCommand command,
@NotNull List<String> configParameters) {
super(project, directory, pathToExecutable, command, configParameters);
myWithMediator = true;
}
public void setUrl(@NotNull String url) {
@@ -117,6 +106,10 @@ public class GitLineHandler extends GitTextHandler {
myIgnoreAuthenticationRequest = ignoreAuthenticationRequest;
}
public void setWithMediator(boolean value) {
myWithMediator = value;
}
protected void processTerminated(final int exitCode) {}
public void addLineListener(GitLineHandlerListener listener) {
@@ -386,7 +386,9 @@ public class GitLogUtil {
@NotNull
private static GitLineHandler createGitHandler(@NotNull Project project, @NotNull VirtualFile root, @NotNull List<String> configParameters) {
return new GitLineHandler(project, root, GitCommand.LOG, configParameters, false);
GitLineHandler handler = new GitLineHandler(project, root, GitCommand.LOG, configParameters);
handler.setWithMediator(false);
return handler;
}
@NotNull
@@ -40,6 +40,7 @@ fun git(project: Project, command: String, ignoreNonZeroExitCode: Boolean = fals
val workingDir = ourCurrentDir()
val split = splitCommandInParameters(command)
val handler = GitLineHandler(project, workingDir, getGitCommandInstance(split[0]))
handler.setWithMediator(false)
handler.addParameters(split.subList(1, split.size))
val result = Git.getInstance().runCommand(handler)