aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-07-29 14:12:30 +0200
committerGuido Günther <agx@sigxcpu.org>2011-07-29 14:12:30 +0200
commit3fb7fd628efa60f12218c7ee7e9f0f4b3e2239e3 (patch)
tree58e925bc3e62a3dfadf637ad4c60c9b8fd314a72 /gbp
parent9bbbc77feb411cc6c72c0bf6df5b0c22e31729e6 (diff)
Add strip option to GitRepository.apply
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/git.py b/gbp/git.py
index a8e95615..ec0b9068 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -469,7 +469,7 @@ class GitRepository(object):
output, ret = self.__git_getoutput('format-patch', options)
return [ line.strip() for line in output ]
- def apply_patch(self, patch, index=True, context=None):
+ def apply_patch(self, patch, index=True, context=None, strip=None):
"""Apply a patch using git apply"""
args = []
@@ -477,6 +477,8 @@ class GitRepository(object):
args += [ '-C', context ]
if index:
args.append("--index")
+ if strip:
+ args += [ '-p', strip ]
args.append(patch)
GitCommand("apply", args)()