@@ -120,12 +120,8 @@ impl<'a> TestFile<'a> {
120120 } ;
121121 }
122122
123- // Run blame to get authorship - use relative path from repo root
124- let filename = file_path
125- . strip_prefix ( & repo. path )
126- . expect ( "file path should be within repo" )
127- . to_str ( )
128- . expect ( "valid path" ) ;
123+ // Run blame to get authorship
124+ let filename = file_path. to_str ( ) . expect ( "valid path" ) ;
129125 let blame_result = repo. git_ai ( & [ "blame" , filename] ) ;
130126
131127 let lines = if let Ok ( blame_output) = blame_result {
@@ -217,11 +213,7 @@ impl<'a> TestFile<'a> {
217213 }
218214
219215 pub fn assert_blame_snapshot ( & self ) {
220- let filename = self . file_path
221- . strip_prefix ( & self . repo . path )
222- . expect ( "file path should be within repo" )
223- . to_str ( )
224- . expect ( "valid path" ) ;
216+ let filename = self . file_path . to_str ( ) . expect ( "valid path" ) ;
225217 let blame_output = self
226218 . repo
227219 . git_ai ( & [ "blame" , filename] )
@@ -234,12 +226,8 @@ impl<'a> TestFile<'a> {
234226 pub fn assert_lines_and_blame < T : Into < ExpectedLine > > ( & mut self , lines : Vec < T > ) {
235227 let expected_lines: Vec < ExpectedLine > = lines. into_iter ( ) . map ( |l| l. into ( ) ) . collect ( ) ;
236228
237- // Get blame output - use relative path from repo root
238- let filename = self . file_path
239- . strip_prefix ( & self . repo . path )
240- . expect ( "file path should be within repo" )
241- . to_str ( )
242- . expect ( "valid path" ) ;
229+ // Get blame output
230+ let filename = self . file_path . to_str ( ) . expect ( "valid path" ) ;
243231 let blame_output = self
244232 . repo
245233 . git_ai ( & [ "blame" , filename] )
@@ -312,12 +300,8 @@ impl<'a> TestFile<'a> {
312300 pub fn assert_committed_lines < T : Into < ExpectedLine > > ( & mut self , lines : Vec < T > ) {
313301 let expected_lines: Vec < ExpectedLine > = lines. into_iter ( ) . map ( |l| l. into ( ) ) . collect ( ) ;
314302
315- // Get blame output - use relative path from repo root
316- let filename = self . file_path
317- . strip_prefix ( & self . repo . path )
318- . expect ( "file path should be within repo" )
319- . to_str ( )
320- . expect ( "valid path" ) ;
303+ // Get blame output
304+ let filename = self . file_path . to_str ( ) . expect ( "valid path" ) ;
321305 let blame_output = self
322306 . repo
323307 . git_ai ( & [ "blame" , filename] )
@@ -446,12 +430,8 @@ impl<'a> TestFile<'a> {
446430
447431 /// Assert that the file at the given path matches the expected contents and authorship
448432 pub fn assert_blame_contents_expected ( & self ) {
449- // Get blame output - use relative path from repo root
450- let filename = self . file_path
451- . strip_prefix ( & self . repo . path )
452- . expect ( "file path should be within repo" )
453- . to_str ( )
454- . expect ( "valid path" ) ;
433+ // Get blame output
434+ let filename = self . file_path . to_str ( ) . expect ( "valid path" ) ;
455435 let blame_output = self
456436 . repo
457437 . git_ai ( & [ "blame" , filename] )
0 commit comments