gosrc: use default branch for GitHub presentations

At present, gosrc assumes that GitHub presentations always store their
files in master branch. If a GitHub repo has a non-master default
branch, then although the presentation file itself is fetched from that
branch, all the files will be retrieved from master, which is a
confusing behaviour.

This change looks up which branch is selected as the default branch, at
the cost of an extra API call against GitHub when a presentation is

Related to #482, although this change merely makes talksapp respect the
default branch, without allowing specification of a particular branch in
the URL.

Change-Id: Ic78f9e86e68696463cb15175d7b133252abf9917
Reviewed-on: https://go-review.googlesource.com/42653
Reviewed-by: Francesc Campoy Flores <campoy@golang.org>
1 file changed