@@ -52,7 +52,23 @@ def test_diff(self, git):
5252 assert_equal (True , diffs [5 ].new_file )
5353
5454 assert_true (git .called )
55- assert_equal (git .call_args , (('diff' , 'master' ), {'full_index' : True }))
55+ assert_equal (git .call_args , (('diff' , '-M' , 'master' ), {'full_index' : True }))
56+
57+ @patch_object (Git , '_call_process' )
58+ def test_diff_with_rename (self , git ):
59+ git .return_value = fixture ('diff_rename' )
60+
61+ diffs = Commit .diff (self .repo , 'rename' )
62+
63+ assert_equal (1 , len (diffs ))
64+
65+ diff = diffs [0 ]
66+ assert_true (diff .renamed )
67+ assert_equal (diff .rename_from , 'AUTHORS' )
68+ assert_equal (diff .rename_to , 'CONTRIBUTORS' )
69+
70+ assert_true (git .called )
71+ assert_equal (git .call_args , (('diff' , '-M' , 'rename' ), {'full_index' : True }))
5672
5773 @patch_object (Git , '_call_process' )
5874 def test_diff_with_two_commits (self , git ):
@@ -63,7 +79,7 @@ def test_diff_with_two_commits(self, git):
6379 assert_equal (3 , len (diffs ))
6480
6581 assert_true (git .called )
66- assert_equal (git .call_args , (('diff' , '59ddc32' , '13d27d5' ), {'full_index' : True }))
82+ assert_equal (git .call_args , (('diff' , '-M' , ' 59ddc32' , '13d27d5' ), {'full_index' : True }))
6783
6884 @patch_object (Git , '_call_process' )
6985 def test_diff_with_files (self , git ):
@@ -75,7 +91,7 @@ def test_diff_with_files(self, git):
7591 assert_equal ('lib/grit/diff.rb' , diffs [0 ].a_path )
7692
7793 assert_true (git .called )
78- assert_equal (git .call_args , (('diff' , '59ddc32' , '--' , 'lib' ), {'full_index' : True }))
94+ assert_equal (git .call_args , (('diff' , '-M' , ' 59ddc32' , '--' , 'lib' ), {'full_index' : True }))
7995
8096 @patch_object (Git , '_call_process' )
8197 def test_diff_with_two_commits_and_files (self , git ):
@@ -87,7 +103,7 @@ def test_diff_with_two_commits_and_files(self, git):
87103 assert_equal ('lib/grit/commit.rb' , diffs [0 ].a_path )
88104
89105 assert_true (git .called )
90- assert_equal (git .call_args , (('diff' , '59ddc32' , '13d27d5' , '--' , 'lib' ), {'full_index' : True }))
106+ assert_equal (git .call_args , (('diff' , '-M' , ' 59ddc32' , '13d27d5' , '--' , 'lib' ), {'full_index' : True }))
91107
92108 @patch_object (Git , '_call_process' )
93109 def test_diffs (self , git ):
@@ -113,7 +129,8 @@ def test_diffs(self, git):
113129 assert_equal (True , diffs [5 ].new_file )
114130
115131 assert_true (git .called )
116- assert_equal (git .call_args , (('diff' , '038af8c329ef7c1bae4568b98bd5c58510465493' ,
132+ assert_equal (git .call_args , (('diff' , '-M' ,
133+ '038af8c329ef7c1bae4568b98bd5c58510465493' ,
117134 '91169e1f5fa4de2eaea3f176461f5dc784796769' ,
118135 ), {'full_index' : True }))
119136
@@ -142,7 +159,7 @@ def test_diffs_on_initial_import(self, git):
142159 assert_equal (True , diffs [5 ].new_file )
143160
144161 assert_true (git .called )
145- assert_equal (git .call_args , (('show' , '634396b2f541a9f2d58b00be1a07f0c358b999b3' ), {'full_index' : True , 'pretty' : 'raw' }))
162+ assert_equal (git .call_args , (('show' , '634396b2f541a9f2d58b00be1a07f0c358b999b3' , '-M' ), {'full_index' : True , 'pretty' : 'raw' }))
146163
147164 @patch_object (Git , '_call_process' )
148165 def test_diffs_on_initial_import_with_empty_commit (self , git ):
@@ -154,7 +171,7 @@ def test_diffs_on_initial_import_with_empty_commit(self, git):
154171 assert_equal ([], diffs )
155172
156173 assert_true (git .called )
157- assert_equal (git .call_args , (('show' , '634396b2f541a9f2d58b00be1a07f0c358b999b3' ), {'full_index' : True , 'pretty' : 'raw' }))
174+ assert_equal (git .call_args , (('show' , '634396b2f541a9f2d58b00be1a07f0c358b999b3' , '-M' ), {'full_index' : True , 'pretty' : 'raw' }))
158175
159176 @patch_object (Git , '_call_process' )
160177 def test_diffs_with_mode_only_change (self , git ):
@@ -169,7 +186,7 @@ def test_diffs_with_mode_only_change(self, git):
169186 assert_equal ('100755' , diffs [0 ].b_mode )
170187
171188 assert_true (git .called )
172- assert_equal (git .call_args , (('show' , '91169e1f5fa4de2eaea3f176461f5dc784796769' ), {'full_index' : True , 'pretty' : 'raw' }))
189+ assert_equal (git .call_args , (('show' , '91169e1f5fa4de2eaea3f176461f5dc784796769' , '-M' ), {'full_index' : True , 'pretty' : 'raw' }))
173190
174191 @patch_object (Git , '_call_process' )
175192 def test_stats (self , git ):
0 commit comments