build: make it possible to pass a "--directory" arg to "git am" (#16024)

This commit is contained in:
Alexey Kuzmin 2018-12-11 22:49:01 +01:00 committed by GitHub
parent 624ade2c25
commit 48abef27d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,11 +40,13 @@ def get_repo_root(path):
return get_repo_root(parent_path)
def am(repo, patch_data, threeway=False,
def am(repo, patch_data, threeway=False, directory=None,
committer_name=None, committer_email=None):
args = []
if threeway:
args += ['--3way']
if directory is not None:
args += ['--directory', directory]
root_args = ['-C', repo]
if committer_name is not None:
root_args += ['-c', 'user.name=' + committer_name]