Merge pull request #2201 from ethomson/gitbuf_test_fix

env test needs to deref git_buf's ptr
Test for giterr_capture