Generate patch with git diff instead of git format-patch

This will generate a patch:

- that is smaller
- that applies more cleanly since only the final diff will be applied
  instead of each commit's diff

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2017-06-09 17:50:53 +02:00
parent 3205901807
commit 4282e610f7
No known key found for this signature in database
GPG Key ID: 46DF07E5CD9E96AB
1 changed files with 3 additions and 7 deletions

View File

@ -76,13 +76,9 @@ module Gitlab
step(
"Generating the patch against origin/master in #{patch_path}",
%w[git format-patch origin/master --stdout]
%W[git diff --binary origin/master > #{patch_path}]
) do |output, status|
throw(:halt_check, :ko) unless status.zero?
File.write(patch_path, output)
throw(:halt_check, :ko) unless File.exist?(patch_path)
throw(:halt_check, :ko) unless status.zero? && File.exist?(patch_path)
end
end
@ -296,7 +292,7 @@ module Gitlab
# In the CE repo
$ git fetch origin master
$ git format-patch origin/master --stdout > #{ce_branch}.patch
$ git diff --binary origin/master > #{ce_branch}.patch
# In the EE repo
$ git fetch origin master