Since --3way insists --index, git diff needs to compare with HEAD.
This commit is contained in:
NARUSE, Yui 2023-03-28 14:25:31 +09:00
Родитель d766d5346b
Коммит 9891797a27
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -204,7 +204,7 @@ class << Merger
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
@ -325,7 +325,7 @@ else
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}"