aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/git
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-06-06 23:24:48 +0300
committerGuido Günther <agx@sigxcpu.org>2013-09-05 11:37:16 +0200
commite48f0a09e8f13a024d8f51c08b3c2b25e886ac7b (patch)
treed1deee164ffef9444e7907d8981f1524514be2c1 /gbp/git
parentbc409569f58a2c9c1c0393c923650bf84f159ddc (diff)
GitRepository.diff: add 'text' option
For generating textual diffs. Useful for Pq - for example, the 'patch' utility does not support git binary diffs. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/git')
-rw-r--r--gbp/git/repository.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 6eed5884..2e8d7796 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1518,7 +1518,8 @@ class GitRepository(object):
args.append(patch)
self._git_command("apply", args)
- def diff(self, obj1, obj2=None, paths=None, stat=False, summary=False):
+ def diff(self, obj1, obj2=None, paths=None, stat=False, summary=False,
+ text=False):
"""
Diff two git repository objects
@@ -1532,6 +1533,8 @@ class GitRepository(object):
@type stat: C{bool} or C{int} or C{str}
@param summary: Show diffstat
@type summary: C{bool}
+ @param text: Generate textual diffs, treat all files as text
+ @type text: C{bool}
@return: diff
@rtype: C{str}
"""
@@ -1541,6 +1544,7 @@ class GitRepository(object):
elif stat:
options.add('--stat=%s' % stat)
options.add_true(summary, '--summary')
+ options.add_true(text, '--text')
options.add(obj1)
options.add_true(obj2, obj2)
if paths: