diff options
author | Aurélien Matouillot <a.matouillot@gmail.com> | 2018-05-15 19:09:21 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2018-05-19 09:36:38 +0200 |
commit | 29aa1b83edf3254f8031cc58188d2da5a83aaf75 (patch) | |
tree | db1d6d04d556e96eaa813de8dd18a82f9462588e /git/diff.py | |
parent | c8fd91020739a0d57f1df562a57bf3e50c04c05b (diff) | |
download | gitpython-29aa1b83edf3254f8031cc58188d2da5a83aaf75.tar.gz |
Add change in type support
Diffstat (limited to 'git/diff.py')
-rw-r--r-- | git/diff.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/git/diff.py b/git/diff.py index 9a3f6b1f..c7300127 100644 --- a/git/diff.py +++ b/git/diff.py @@ -165,8 +165,9 @@ class DiffIndex(list): # A = Added # D = Deleted # R = Renamed - # M = modified - change_type = ("A", "D", "R", "M") + # M = Modified + # T = Changed in the type + change_type = ("A", "D", "R", "M", "T") def iter_change_type(self, change_type): """ @@ -179,7 +180,9 @@ class DiffIndex(list): * 'A' for added paths * 'D' for deleted paths * 'R' for renamed paths - * 'M' for paths with modified data""" + * 'M' for paths with modified data + * 'T' for changed in the type paths + """ if change_type not in self.change_type: raise ValueError("Invalid change type: %s" % change_type) @@ -499,6 +502,9 @@ class Diff(object): a_path = a_path.encode(defenc) b_path = b_path.encode(defenc) rename_from, rename_to = a_path, b_path + elif change_type == 'T': + # Nothing to do + pass # END add/remove handling diff = Diff(repo, a_path, b_path, a_blob_id, b_blob_id, old_mode, new_mode, |