Skip to content

Add support for 'C'-type diffs #945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 19, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Expanded new test for copied file
  • Loading branch information
thetwoj committed Oct 18, 2019
commit 4b3e87b79a13248329a4ea401f248857eaa825e0
5 changes: 4 additions & 1 deletion git/test/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def test_diff_with_copied_file(self):

diff = diffs[0]
assert_true(diff.copied_file)
assert_true(diff.a_path, u'test1.txt')
assert_true(diff.b_path, u'test2.txt')
assert isinstance(str(diff), str)

output = StringProcessAdapter(fixture('diff_copied_mode_raw'))
Expand All @@ -129,9 +131,10 @@ def test_diff_with_copied_file(self):
diff = diffs[0]
self.assertEqual(diff.change_type, 'C')
self.assertEqual(diff.score, 100)
self.assertEqual(diff.a_path, u'test1.txt')
self.assertEqual(diff.b_path, u'test2.txt')
self.assertEqual(len(list(diffs.iter_change_type('C'))), 1)


def test_diff_with_change_in_type(self):
output = StringProcessAdapter(fixture('diff_change_in_type'))
diffs = Diff._index_from_patch_format(self.rorepo, output)
Expand Down