Sha256: 235834499177f3a24ad7c848ea1da7a51f03ed48717add2800d734695a81b182

Contents?: true

Size: 914 Bytes

Versions: 1

Compression:

Stored size: 914 Bytes

Contents

require 'colorize'
require_relative '../util/submodule'

module GGSM
  module Merge
    include Submodule

    def merge_flow(branch)
      check_submodule
      check_un_commit_code

      arry_conflict = []

      foreach_module {|sub|
        process_merge(arry_conflict, sub, branch)
      }

      puts '==> 进入主工程:'.yellow
      process_merge(arry_conflict, '主工程', branch)
      puts "Modules执行:git merge #{branch}".blue

      if arry_conflict.size > 0
        tip = "==> #{arry_conflict.size}个模块冲突:"
        arry_conflict.reverse.each do |sub|
          tip = "#{tip}  #{sub}"
        end
        puts tip.red
      end
    end

    def process_merge(arry_conflict, module_name, branch)
      result_merge = `git merge #{branch}`
      puts result_merge

      if result_merge.include? 'Merge conflict'
        arry_conflict.push(module_name)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ggsm-1.4.0 lib/ggsm/flow/merge.rb