Class: Git::Lib

Inherits:
Object
  • Object
show all
Defined in:
lib/crystalball/extensions/git/lib.rb

Overview

Class wich holds whole collection of raw methods to work with git

Instance Method Summary collapse

Instance Method Details

#merge_base(*args) ⇒ String

‘git merge-base …`. Returns common ancestor for all passed commits

Parameters:

  • args (Array<Object>)
    • list of commits to process. Last argument can be options for merge-base command

Returns:

  • (String)


10
11
12
13
14
15
16
# File 'lib/crystalball/extensions/git/lib.rb', line 10

def merge_base(*args)
  opts = args.last.is_a?(Hash) ? args.pop : {}

  arg_opts = opts.map { |k, v| "--#{k}" if v }.compact + args

  command('merge-base', arg_opts)
end