make tree branch aware

Uses the github api's `ref` HTTP header to add branch support.

fixes #1