Module: GitAutoCheckout

Defined in:
lib/git_auto_checkout.rb,
lib/git_auto_checkout/git_commit.rb,
lib/git_auto_checkout/git_checkout_helper.rb

Defined Under Namespace

Classes: GitCheckoutHelper, GitCommit

Class Method Summary collapse

Class Method Details

.runObject



8
9
10
11
12
13
14
15
16
# File 'lib/git_auto_checkout.rb', line 8

def run
  if `git rev-parse --is-inside-work-tree 2>&1`.split.first == "fatal:"
    $stderr.puts "Error: current directory is not a git repository"
    exit 1
  end

  git_checkout_helper = GitCheckoutHelper.new
  git_checkout_helper.make_commit
end