Sha256: 61522de99c1ad8188777342092becda6d80c19f0f5c877548ed957fffab00fcd

Contents?: true

Size: 759 Bytes

Versions: 42

Compression:

Stored size: 759 Bytes

Contents

require_relative "../scripts"

module Octopolo
  module Scripts
    class SyncBranch
      include ConfigWrapper
      include CLIWrapper
      include GitWrapper

      attr_accessor :branch

      def self.execute(branch=nil)
        new(branch).execute
      end

      def initialize(branch=nil)
        @branch = branch || default_branch
      end

      # Public: Default value of branch if none given
      def default_branch
        config.deploy_branch
      end

      def execute
        merge_branch
      end

      # Public: Merge the specified remote branch into your local
      def merge_branch
        git.merge branch
      rescue Git::MergeFailed
        cli.say "Merge failed. Please resolve these conflicts."
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
octopolo-1.12.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.11.4 lib/octopolo/scripts/sync_branch.rb
octopolo-1.11.3 lib/octopolo/scripts/sync_branch.rb
octopolo-1.11.1 lib/octopolo/scripts/sync_branch.rb
octopolo-1.11.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.9.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.8.1 lib/octopolo/scripts/sync_branch.rb
octopolo-1.8.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.7.1 lib/octopolo/scripts/sync_branch.rb
octopolo-1.7.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.6.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.5.3 lib/octopolo/scripts/sync_branch.rb
octopolo-1.5.2 lib/octopolo/scripts/sync_branch.rb
octopolo-1.5.1 lib/octopolo/scripts/sync_branch.rb
octopolo-1.5.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.4.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.3.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.2.1 lib/octopolo/scripts/sync_branch.rb
octopolo-1.2.0 lib/octopolo/scripts/sync_branch.rb
octopolo-1.1.1 lib/octopolo/scripts/sync_branch.rb