IDEA-79817 Better detection of rejected push; fix setStderrSuppressed in setSilent.
authorKirill Likhodedov <Kirill.Likhodedov@gmail.com>
Mon, 30 Jan 2012 12:02:20 +0000 (16:02 +0400)
committerKirill Likhodedov <Kirill.Likhodedov@jetbrains.com>
Mon, 30 Jan 2012 12:12:27 +0000 (16:12 +0400)
For branches with hyphens, for example.

[Reviewed by irengrig]
(cherry picked from commit 9d67aa2f6c29e260d8e44d94577c4cac691c83f0)

plugins/git4idea/src/git4idea/commands/GitHandler.java
plugins/git4idea/src/git4idea/push/GitPushRejectedDetector.java

index 79e0779f14d86859f9399602bf8b7447e746f40d..dd7ac999af35f2afd909a37f481e8d1e698e0988 100644 (file)
@@ -502,8 +502,8 @@ public abstract class GitHandler {
   public void setSilent(final boolean silent) {
     checkNotStarted();
     mySilent = silent;
-    setStderrSuppressed(true);
-    setStdoutSuppressed(true);
+    setStderrSuppressed(silent);
+    setStdoutSuppressed(silent);
   }
 
   /**
index 0dc47f2cdeb86064cb1bb0a3d2b2d7f6fc6b30f2..ca96475cfeecdff017e7b49335d52f241b1c6c70 100644 (file)
@@ -28,7 +28,7 @@ import java.util.regex.Pattern;
  */
 class GitPushRejectedDetector implements GitLineHandlerListener {
 
-  private static final Pattern REJECTED_PATTERN = Pattern.compile("\\s+! \\[rejected\\]\\s+(\\w+) -> (\\w+) .*");
+  private static final Pattern REJECTED_PATTERN = Pattern.compile("\\s+! \\[rejected\\]\\s+(\\S+) -> (\\S+) .*");
   
   private final Collection<RejectedRef> myRejectedRefs = new ArrayList<RejectedRef>();