summaryrefslogtreecommitdiff
path: root/git/diff.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-09 15:07:50 +0100
committerYobmod <yobmod@gmail.com>2021-07-09 15:07:50 +0100
commit7c6ae2b94cfd1593c12366b6abc0cd5bbb6e07b2 (patch)
tree65288c0fc32f295ebe440a27033d4270ea8430f5 /git/diff.py
parent627166094f9280a3e00b755b754a4bd6ed72bb66 (diff)
downloadgitpython-7c6ae2b94cfd1593c12366b6abc0cd5bbb6e07b2.tar.gz
Try to distinguation git.diff module from diff.Diff.diff and diff.Daffable.diff()
Diffstat (limited to 'git/diff.py')
-rw-r--r--git/diff.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/git/diff.py b/git/diff.py
index cb216299..71bbdf75 100644
--- a/git/diff.py
+++ b/git/diff.py
@@ -212,19 +212,19 @@ class DiffIndex(List[T_Diff]):
if change_type not in self.change_type:
raise ValueError("Invalid change type: %s" % change_type)
- for diff in self:
- if diff.change_type == change_type:
- yield diff
- elif change_type == "A" and diff.new_file:
- yield diff
- elif change_type == "D" and diff.deleted_file:
- yield diff
- elif change_type == "C" and diff.copied_file:
- yield diff
- elif change_type == "R" and diff.renamed:
- yield diff
- elif change_type == "M" and diff.a_blob and diff.b_blob and diff.a_blob != diff.b_blob:
- yield diff
+ for diffidx in self:
+ if diffidx.change_type == change_type:
+ yield diffidx
+ elif change_type == "A" and diffidx.new_file:
+ yield diffidx
+ elif change_type == "D" and diffidx.deleted_file:
+ yield diffidx
+ elif change_type == "C" and diffidx.copied_file:
+ yield diffidx
+ elif change_type == "R" and diffidx.renamed:
+ yield diffidx
+ elif change_type == "M" and diffidx.a_blob and diffidx.b_blob and diffidx.a_blob != diffidx.b_blob:
+ yield diffidx
# END for each diff