pry/pry-git — pull request #5 by davidbalbert (2012-07-13 17:59:55+00:00)
Title: Capture standard error when shelling out to git

`find_git_root` checks stdout for error messages, but error messages are printed to standard error. Thus we get an exception later on in the code because the error check failed. Here's what currently happens:

```
[1] pry(main)> git blame Pry.start
fatal: Not a git repository (or any of the parent directories): .git
NoMethodError: undefined method `trees' for nil:NilClass
from /Users/david/Development/pry-git/lib/pry-git.rb:19:in `block in get_file_from_commit'
```

The "fatal line is git's standard error, the next two lines are from later because of the broken error check.

With this fix, the output becomes:

```
[1] pry(main)> git blame Pry.start
Error: No git repository found in
/Users/david/.rvm/gems/ruby-1.9.3-p194/gems/pry-0.9.9.6/lib/pry
```