diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-07-30 14:36:48 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-07-31 13:30:58 +0200 |
commit | a983b342431d217800188367abe3bdedce01717a (patch) | |
tree | b5a3fe43d4a18db0cbcf22530af9e117164a6487 | |
parent | 3d261da774b79a4d8b280b9e10558ad6af3111b4 (diff) |
GitRepository: Allow to fix up whitespace when applying a patch
-rw-r--r-- | gbp/git/repository.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index ba42be0a..60656652 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1651,13 +1651,15 @@ class GitRepository(object): output, ret = self._git_getoutput('format-patch', options.args) return [ line.strip() for line in output ] - def apply_patch(self, patch, index=True, context=None, strip=None): + def apply_patch(self, patch, index=True, context=None, strip=None, fix_ws=False): """Apply a patch using git apply""" args = [] if context: args += [ '-C', context ] if index: args.append("--index") + if fix_ws: + args.append("--whitespace=fix") if strip != None: args += [ '-p', str(strip) ] args.append(patch) |