1
0
Fork 0

using git apply

fixes problems for failing windows builds
This commit is contained in:
Christian Kühnel 2020-02-17 09:07:30 +00:00
parent e94ecbbd88
commit 2da32a0cdf

View file

@ -159,7 +159,7 @@ class ApplyPatch:
print('Applying diff {} for revision {}...'.format(diff_id, diff_to_str(revision_id)))
# TODO: print diff or URL to it
diff = try_call(lambda: self.phab.differential.getrawdiff(diffID=str(diff_id)).response)
proc = subprocess.run('patch -p1', input=diff, shell=True, text=True,
proc = subprocess.run('git apply --ignore-whitespace -', input=diff, shell=True, text=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if proc.returncode != 0:
raise Exception('Applying patch failed:\n{}'.format(proc.stdout + proc.stderr))