This PR more nicely handles a missing default branch in owner/repo/branches Fix #18265 Signed-off-by: Andrew Thornton <art27@cantab.net>