diff options
author | Sebastian Thiel <sebastian.thiel@icloud.com> | 2023-02-02 08:21:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-02 08:21:30 +0100 |
commit | 6ed2285abd917fa8864a160225375a3f53f0b20c (patch) | |
tree | 642c2b873ba8e1d54cfc3ac913900936ced8da24 /git/diff.py | |
parent | 63a60b3824ac7b756034ca50a6b0bbc61602a358 (diff) | |
parent | c0e69a4263a7f42b7a7d8bb44d11ee3d14a27545 (diff) | |
download | gitpython-6ed2285abd917fa8864a160225375a3f53f0b20c.tar.gz |
Merge pull request #1551 from mellowed100/main
Enable user to override default diff -M arg
Diffstat (limited to 'git/diff.py')
-rw-r--r-- | git/diff.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git/diff.py b/git/diff.py index c4424592..c1a5bd26 100644 --- a/git/diff.py +++ b/git/diff.py @@ -144,7 +144,10 @@ class Diffable(object): args.append("--abbrev=40") # we need full shas args.append("--full-index") # get full index paths, not only filenames - args.append("-M") # check for renames, in both formats + # remove default '-M' arg (check for renames) if user is overriding it + if not any(x in kwargs for x in ('find_renames', 'no_renames', 'M')): + args.append("-M") + if create_patch: args.append("-p") else: |