title: ProcessBuilder with GIT command gives no result
body: <p>I try using the Process Builder to execute a git command.
  But it does not seem to work any command.</p>
  
  <p><code>git log</code> gives me the right result.</p>
  
  <p><code>git shortlog -s</code> but ends in a TimeOut!</p>
  
  <p>Both commands run in a terminal provide the correct result!
  I have tested on Win and Mac.</p>
  
  <p>Does anyone have any idea how I can debug this, or where my mistake is?</p>
  
  <p>Or maybe a different solution?
  The aim is to read out the committer to a specific file in a git repository.</p>
  
  <p>The fact Git command is <code>git shortlog -s -p FeilePath</code> ?</p>
  
  <p>My Test Code:</p>
  
  <pre><code> @Test
      public void testCommandListDir() {
  
          File execDir = new File("./");
          String returnValue = "";
  
          try {
              returnValue = runCommand(execDir, 10, TimeUnit.SECONDS, "git", "log");
          } catch (IOException e) {
              e.printStackTrace();
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
          assertTrue(returnValue.contains("+ try and error for git shortlog"));
      }
  
  
      @Test
      public void testCommandGitShortlog() {
  
          File execDir = new File("./");
          String returnValue = "";
  
          try {
              returnValue = runCommand(execDir, 10, TimeUnit.SECONDS, "git", "shortlog", "-s");
          } catch (IOException e) {
              e.printStackTrace();
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
          assertTrue(returnValue.equals(""));
      }
  
      public static String runCommand(File directory, long timeout, TimeUnit unit, String... command) throws IOException, InterruptedException {
  
          StringBuilder sb = new StringBuilder();
  
          ProcessBuilder pb = new ProcessBuilder(command)
                  .redirectErrorStream(true).directory(directory);
  
  
          Process p = pb.start();
  
          InputStream is = p.getInputStream();
          InputStream es = p.getErrorStream();
          BufferedReader br = new BufferedReader(new InputStreamReader(is));
          BufferedReader bre = new BufferedReader(new InputStreamReader(es));
          String in;
  
          boolean timeOut = false;
  
  
          if (!p.waitFor(timeout, unit)) {
              //timeout - kill the process.
              p.destroy(); // consider using destroyForcibly instead
              timeOut = true;
          }
  
          if (timeOut) {
              //write time out msg
              sb.append("RunCommand time out! after " + timeout + " " + unit.toString() + "\n");
              sb.append("     directory: " + directory.getAbsolutePath() + "\n");
              sb.append("     command: " + command + "\n");
          } else {
              while ((in = br.readLine()) != null) {
                  sb.append(in + "\n");
              }
  
              while ((in = bre.readLine()) != null) {
                  sb.append(in + "\n");
              }
          }
          return sb.toString();
      }
  </code></pre>