title: git pull not working in Groovy
body: <p>I'm new to the Groovy language and am using it to write a custom parameter for a Jenkins job. In the script below, the first ("git checkout master") and last ("git branch -r --no-merged master") commands work just fine. However, the git pull doesn't execute as there is no output other than the initial '[git pull]' that I've commented below. What is returned from the last command, "git branch -r --no-merged master" is not correct because my origin is ahead of my local.</p>
  
  <pre><code>def dir = "C:/JenkinsBuilds/WidgetLoader/Source"
  def srcDir = new File(dir)
  
  String command1 = "git checkout master"
  println ("[$command1]")
  Process process1 = command1.execute(null, srcDir)
  process1.waitFor()
  println(process1.text)
  
  String command2 = "git pull origin master"
  println ("[$command2]") // This will output
  Process process2 = command2.execute(null, srcDir) 
  process2.waitFor()
  println(process2.text) // Only a blank line is outputted
  
  String command3 = "git branch -r --no-merged master"
  println ("[$command3]")
  Process process3 = command3.execute(null, srcDir)
  process3.waitFor()
  println(process3.text)
  
  def branches = ["-- SELECT BRANCH --","master"]
  
  process3.text.eachLine {line -&gt; branches.add(line.trim().replaceAll('origin/', ''))}
  
  return branches
  </code></pre>
  
  <p>This is what gets returned</p>
  
  <p>[(master)]:
  [git checkout master]
  Your branch is behind 'origin/master' by 10 commits, and can be fast-forwarded.
    (use "git pull" to update your local branch)</p>
  
  <p>[git pull]</p>
  
  <p>[git branch -r --no-merged master]
    origin/HEAD -> origin/master
    origin/master
    origin/testb1
    origin/testb2</p>