Sha256: 55349ea29b4ea17f2172beef201c2da8a741eb52278d724ba7dae87500679f6a

Contents?: true

Size: 942 Bytes

Versions: 12

Compression:

Stored size: 942 Bytes

Contents

require 'papa/command/base'
require 'papa/command/git/rebase_abort'
require 'papa/command/git/checkout'

module Papa
  module Command
    module Git
      class Rebase < Command::Base
        def initialize(base_branch_name)
          @base_branch_name = base_branch_name
          command = "git rebase #{@base_branch_name}"
          super(command)
        end

        def run
          current_branch # Store current branch before executing command
          super
        end

        def cleanup
          super
          queue = [
            Git::RebaseAbort.new,
            Git::Checkout.new(current_branch)
          ]
          runner = Runner.new(queue)
          runner.run
        end

        def failure_message
          super
          message = "Failed to rebase #{current_branch} from #{@base_branch_name}. Merge conflict?"
          Helper::Output.error message
          message
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
papa-1.2.0 lib/papa/command/git/rebase.rb
papa-1.1.0 lib/papa/command/git/rebase.rb
papa-1.0.0 lib/papa/command/git/rebase.rb
papa-0.7.2 lib/papa/command/git/rebase.rb
papa-0.7.1 lib/papa/command/git/rebase.rb
papa-0.7.0 lib/papa/command/git/rebase.rb
papa-0.6.2 lib/papa/command/git/rebase.rb
papa-0.6.1 lib/papa/command/git/rebase.rb
papa-0.6.0 lib/papa/command/git/rebase.rb
papa-0.5.0 lib/papa/command/git/rebase.rb
papa-0.4.1 lib/papa/command/git/rebase.rb
papa-0.4.0 lib/papa/command/git/rebase.rb