summaryrefslogtreecommitdiff
path: root/git/test
diff options
context:
space:
mode:
Diffstat (limited to 'git/test')
-rw-r--r--git/test/fixtures/diff_rename_raw1
-rw-r--r--git/test/test_diff.py9
2 files changed, 10 insertions, 0 deletions
diff --git a/git/test/fixtures/diff_rename_raw b/git/test/fixtures/diff_rename_raw
new file mode 100644
index 00000000..92d06d22
--- /dev/null
+++ b/git/test/fixtures/diff_rename_raw
@@ -0,0 +1 @@
+:100644 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 R100 this that
diff --git a/git/test/test_diff.py b/git/test/test_diff.py
index c5183089..ce0f64f2 100644
--- a/git/test/test_diff.py
+++ b/git/test/test_diff.py
@@ -56,6 +56,15 @@ class TestDiff(TestBase):
assert_equal(diff.rename_from, 'AUTHORS')
assert_equal(diff.rename_to, 'CONTRIBUTORS')
+ output = StringProcessAdapter(fixture('diff_rename_raw'))
+ diffs = Diff._index_from_raw_format(self.rorepo, output.stdout)
+ assert len(diffs) == 1
+ diff = diffs[0]
+ assert diff.renamed
+ assert diff.rename_from == 'this'
+ assert diff.rename_to == 'that'
+ assert len(list(diffs.iter_change_type('R'))) == 1
+
def test_diff_patch_format(self):
# test all of the 'old' format diffs for completness - it should at least
# be able to deal with it