File: commit_branches.rb

package info (click to toggle)
ruby-octokit 10.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,092 kB
  • sloc: ruby: 13,339; sh: 99; makefile: 7; javascript: 3
file content (20 lines) | stat: -rw-r--r-- 705 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

module Octokit
  class Client
    # Methods for the Branches for HEAD API
    #
    # @see https://developer.github.com/v3/repos/commits/
    module CommitBranches
      # List branches for a single HEAD commit
      #
      # @param repo [Integer, String, Hash, Repository] A GitHub repository
      # @param sha [String] The SHA of the commit whose branches will be fetched
      # @return [Array]  List of branches
      # @see https://developer.github.com/v3/repos/commits/#list-branches-for-head-commit
      def commit_branches(repo, sha, options = {})
        paginate "#{Repository.path repo}/commits/#{sha}/branches-where-head", options
      end
    end
  end
end