X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/ba5cb156fc92a5dc6160cefa1d65fff46ff1b09f..c18842cc149803ab61f716c84c96bf7d61a5c0fc:/stgit/git.py diff --git a/stgit/git.py b/stgit/git.py index 268c44b..012e282 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -818,7 +818,7 @@ def repack(): GRun('repack', '-a', '-d', '-f').run() def apply_patch(filename = None, diff = None, base = None, - fail_dump = True, reject = False): + fail_dump = True, reject = False, strip = None): """Apply a patch onto the current or given index. There must not be any local changes in the tree, otherwise the command fails """ @@ -840,6 +840,8 @@ def apply_patch(filename = None, diff = None, base = None, cmd = ['apply', '--index'] if reject: cmd += ['--reject'] + if strip != None: + cmd += ['-p', str(strip)] try: GRun(*cmd).raw_input(diff).no_output() except GitRunException: