From 3fb7fd628efa60f12218c7ee7e9f0f4b3e2239e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20G=C3=BCnther?= Date: Fri, 29 Jul 2011 14:12:30 +0200 Subject: [PATCH] Add strip option to GitRepository.apply --- gbp/git.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gbp/git.py b/gbp/git.py index a8e9561..ec0b906 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)() -- 2.7.4