aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-05-26 16:30:29 +0200
committerGuido Günther <agx@sigxcpu.org>2017-05-26 16:30:29 +0200
commit96cd17dfd1e4dc51a1172f7cb0b9b718c6a05c48 (patch)
treebbb1048f79719846394e73e8de7b3f7bb0a92f64
parent81c3d533a07c6602f07907b82b12d885239ca013 (diff)
repository: allow to specify rename tracking
-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 a55c477..0f2c633 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1761,7 +1761,7 @@ class GitRepository(object):
self._git_command("apply", args)
def diff(self, obj1, obj2=None, paths=None, stat=False, summary=False,
- text=False, ignore_submodules=True, abbrev=None):
+ text=False, ignore_submodules=True, abbrev=None, renames=False):
"""
Diff two git repository objects
@@ -1791,6 +1791,10 @@ class GitRepository(object):
options.add_true(summary, '--summary')
options.add_true(text, '--text')
options.add_true(ignore_submodules, '--ignore-submodules=all')
+ if isinstance(renames, bool):
+ options.add('-M' if renames else '--no-renames')
+ else:
+ options.add('-M=%s', renames)
options.add(obj1)
options.add_true(obj2, obj2)
if paths: