Module: LibRevList

Included in:
Git::Lib
Defined in:
lib/git/rev_list.rb

Instance Method Summary collapse

Instance Method Details

#rev_list(committish = nil, opts = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/git/rev_list.rb', line 4

def rev_list(committish = nil, opts = {})
  arr_opts = []

  opts.each do |k, v|
    # allow for passing, say, :max-count or :max_count
    k = k.to_s
    k.tr!('_', '-')
    if v && v.to_s.downcase == 'true'
      arr_opts << "--#{k}"
    elsif v
      arr_opts << "--#{k}=#{v}"
    end
  end

  arr_opts << committish if committish

  command('rev-list', arr_opts)
end