patchinstall.py: Use --git-dir instead of -C.

This reportedly works better for nested git trees.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51877
This commit is contained in:
Zebediah Figura 2023-03-20 17:44:27 -05:00
parent 09634de79c
commit cf29ed121d

View File

@ -76,16 +76,17 @@ def parse_def_file(name, path):
return deps
def apply_patch(patch):
gitdir = os.path.join(winedir,'.git')
if backend == 'git-am':
return run(['git','-C',winedir,'am',patch])
return run(['git','--git-dir',gitdir,'am',patch])
elif backend == 'git-am-C1':
return run(['git','-C',winedir,'am','-C1',patch])
return run(['git','--git-dir',gitdir,'am','-C1',patch])
elif backend == 'patch':
with open(patch) as f:
print(patchdir+'/gitapply.sh -d', winedir, '<', patch)
return subprocess.call([patchdir+'/gitapply.sh','-d',winedir],stdin=f)
elif backend == 'git-apply':
return run(['git','-C',winedir,'apply','--index',patch])
return run(['git','--git-dir',gitdir,'apply','--index',patch])
def run_autoconf(patch):
if not force_autoconf: return
@ -107,7 +108,8 @@ def run_autoconf(patch):
if need_make_requests:
run(['./tools/make_requests'], cwd=winedir)
if need_autoreconf or need_make_requests:
run(['git','-C',winedir,'commit','-a','--amend','--no-edit'])
gitdir = os.path.join(winedir,'.git')
run(['git','--git-dir',gitdir,'commit','-a','--amend','--no-edit'])
def add_patch_data(patch):
global patch_data