Skip to content

Commit

Permalink
Use 3 way merge for merger.rb
Browse files Browse the repository at this point in the history
Since --3way insists --index, git diff needs to compare with HEAD.
  • Loading branch information
nurse committed Mar 28, 2023
1 parent d766d53 commit 9891797
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tool/merger.rb
Expand Up @@ -204,7 +204,7 @@ def diff(file = nil)
if svn_mode?
command = %w[svn diff --diff-cmd=diff -x -upw]
else
command = %w[git diff --color]
command = %w[git diff --color HEAD]
end
IO.popen(command + [file].compact, &:read)
end
Expand Down Expand Up @@ -325,7 +325,7 @@ def execute(*cmd, interactive: false)

message = "\n\n#{(patch[/^Subject: (.*)\n\ndiff --git/m, 1] || "Message not found for revision: #{git_rev}\n")}"
puts '+ git apply'
IO.popen(['git', 'apply'], 'wb') { |f| f.write(patch) }
IO.popen(['git', 'apply', '--3way'], 'wb') { |f| f.write(patch) }
else
default_merge_branch = (%r{^URL: .*/branches/ruby_1_8_} =~ `svn info` ? 'branches/ruby_1_8' : 'trunk')
svn_src = "#{Merger::REPOS}#{ARGV[1] || default_merge_branch}"
Expand Down

0 comments on commit 9891797

Please sign in to comment.