title: Why does git-pull fail with signal 13?
body: <h1>Setup</h1>
  
  <p>I've written a small script to do automatic pull/commit/push for some personal data. This script works great on my laptop (version 1.8.3.2-1) but on my server, the <code>git pull</code> command is failing with signal 13. I was running version 1.7.9.5-1 (these are both ubuntu, but the server is 12.04.4 LTS vs 13.10 on the laptop), I used the ppa:git-core repo to update git to 1.9.0-1~ppa0~precise1. This still gives the same problem with my script. The complication perhaps, is that the laptop pulls from a bare repo on the server over ssh while the server pulls from the same bare repo (to a working copy elsewhere) but doesn't use ssh, it just has the local path.</p>
  
  <h1>The problem</h1>
  
  <p>I can reproduce the problem in the terminal with the following command:</p>
  
  <pre><code>&gt; git pull origin master | read msg; echo ${msg}
  First, rewinding head to replay your work on top of it...
  error: git-pull died of signal 13
  </code></pre>
  
  <p>This seems to fetch the commit and check it out, but does not update the master branch and leaves the repo off branch:</p>
  
  <pre><code>&gt; git status
  # Not currently on any branch.
  nothing to commit (working directory clean)
  </code></pre>
  
  <p>Switching back to master gives a warning:</p>
  
  <pre><code>&gt; git checkout master
  Warning: you are leaving 1 commit behind, not connected to
  any of your branches:
  
    7220b8f Commit message
  
  If you want to keep them by creating a new branch, this may be a good time
  to do so with:
  
   git branch new_branch_name 7220b8f5e2648ae49d3e3095e8bf942dfc41421c
  
  Switched to branch 'master'
  </code></pre>
  
  <h1>My attempts to fix</h1>
  
  <p>Thinking the problem was due to stdout being a pipe but stderr being a tty, I tried:</p>
  
  <pre><code>&gt; git pull origin master 2&gt;&amp;1 | read msg; echo ${msg}
  </code></pre>
  
  <p>But this does nothing at all and leaves <code>${msg}</code> empty.</p>
  
  <p>What does work is:</p>
  
  <pre><code>&gt; git pull --quiet origin master 2&gt;&amp;1 | read msg; echo ${msg}
  
  &gt; git pull --quiet origin master
  
  &gt; git pull origin master
  </code></pre>
  
  <p>All of which do fetch the commit and update master. I'd like to capture output from git-pull in some cases so while I can fix up the repo, I'd like to know why this is happening.</p>
  
  <p>So why can't I capture the output of git-pull, and why does it crash out leaving the repo in such a state?</p>