From b82dfdb0f94a416db82414c845c741cb89f0a7d0 Mon Sep 17 00:00:00 2001 From: Aleksandr Krasilnikov Date: Tue, 21 May 2019 14:27:12 +0300 Subject: [PATCH] [git] fix remote operation execution on Linux Was broken in 0ee84fb5c GitOrigin-RevId: c7031826c77f44371c7bfa303eafdd8241dfdc11 --- .../git4idea/src/git4idea/commands/GitHandler.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/commands/GitHandler.java b/plugins/git4idea/src/git4idea/commands/GitHandler.java index 07d863876fa3..3dd4aa6a78ff 100644 --- a/plugins/git4idea/src/git4idea/commands/GitHandler.java +++ b/plugins/git4idea/src/git4idea/commands/GitHandler.java @@ -65,6 +65,12 @@ public abstract class GitHandler { @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"}) protected boolean mySilent; // if true, the command execution is not logged in version control view + @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"}) + private boolean myWithLowPriority; + @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"}) + private boolean myWithNoTty; + + @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized"}) private long myStartTime; // git execution start timestamp private static final long LONG_TIME = 10 * 1000; @@ -194,14 +200,14 @@ public abstract class GitHandler { * Execute process with lower priority */ public void withLowPriority() { - ExecUtil.setupLowPriorityExecution(myCommandLine); + myWithLowPriority = true; } /** * Detach git process from IDE TTY session */ public void withNoTty() { - ExecUtil.setupNoTtyExecution(myCommandLine); + myWithNoTty = true; } /** @@ -476,6 +482,9 @@ public abstract class GitHandler { checkNotStarted(); try { + if (myWithLowPriority) ExecUtil.setupLowPriorityExecution(myCommandLine); + if (myWithNoTty) ExecUtil.setupNoTtyExecution(myCommandLine); + myStartTime = System.currentTimeMillis(); String logDirectoryPath = myProject != null ? GitImplBase.stringifyWorkingDir(myProject.getBasePath(), myCommandLine.getWorkDirectory())