title: How can I get branch count on a repository via GitHub API?
body: <p>I'm <a href="https://github.com/djjd47130/GitHubBackup/issues/25" rel="nofollow noreferrer">working on a UI</a> which lists all repositories of a given user or organization. This is using a tree format, where the first level is the repositories, and the second level of hierarchy (child nodes) are to be each branch, if expanded.</p>
  
  <p>I'm using a mechanism that deliberately doesn't require me to pull a list of all branches of a given repo, because the API has rate limits on API calls. Instead, all I have to do is instruct it how many child nodes it contains, without actually assigning values to them (until the moment the user expands it). I was almost sure that fetching a list of repos includes branch count in the result, but to my disappointment, I don't see it. I can only see count of forks, stargazers, watchers, issues, etc. Everything except branch count.</p>
  
  <p>The intention of the UI is that it will know in advance the number of branches to populate the child nodes, but not actually fetch them until <strong>after</strong> user has expanded the parent node - thus immediately showing <strong>empty placeholders</strong> for each branch, followed by asynchronous loading of the actual branches to populate. Again, since I need to avoid too many API calls. As user scrolls, <strong>it will use pagination</strong> to fetch only the page(s) it needs to show to the user, and keep it cached for later display.</p>
  
  <p>Specifically, I'm using the Virtual TreeView for Delphi:</p>
  
  <pre><code>procedure TfrmMain.LstInitChildren(Sender: TBaseVirtualTree; Node: PVirtualNode;
    var ChildCount: Cardinal);
  var
    L: Integer;
    R: TGitHubRepo;
  begin
    L:= Lst.GetNodeLevel(Node);
    case L of
      0: begin
        //TODO: Return number of branches...
        R:= TGitHubRepo(Lst.GetNodeData(Node));
        ChildCount:= R.I['branch_count']; //TODO: There is no such thing!!!
      end;
      1: ChildCount:= 0; //Branches have no further child nodes
    end;
  end;
  </code></pre>
  
  <p>Is there something I'm missing that allows me to get repo branch count without having to fetch a complete list of all of them up-front?</p>