Sha256: 81872b9e8ca2710d3964d28bf5449bc3139a1b5a4b34dcc992b89ac2f0e64d95

Contents?: true

Size: 872 Bytes

Versions: 6

Compression:

Stored size: 872 Bytes

Contents

require 'papa/command/base'

module Papa
  module Command
    module Git
      class Merge < Command::Base
        def initialize(branch_name)
          @branch_name = branch_name
          command = "git merge #{@branch_name} --no-ff"
          super(command)
        end

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

        def cleanup
          super
          require 'papa/command/git/merge_abort'
          require 'papa/command/git/checkout'

          Command::Git::MergeAbort.new.run
          Command::Git::Checkout.new(current_branch).run
        end

        def failure_message
          super
          message = "Failed to merge #{@branch_name} into #{current_branch}. Merge conflict?"
          Helper::Output.error message
          message
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
papa-1.2.0 lib/papa/command/git/merge.rb
papa-1.1.0 lib/papa/command/git/merge.rb
papa-1.0.0 lib/papa/command/git/merge.rb
papa-0.7.2 lib/papa/command/git/merge.rb
papa-0.7.1 lib/papa/command/git/merge.rb
papa-0.7.0 lib/papa/command/git/merge.rb