47
47
import java .util .Collections ;
48
48
import java .util .Date ;
49
49
import java .util .HashMap ;
50
- import java .util .HashSet ;
51
50
import java .util .List ;
52
51
import java .util .ListIterator ;
53
52
import java .util .Map ;
@@ -434,7 +433,6 @@ public void store(History history, Repository repository, String tillRevision) t
434
433
435
434
HashMap <String , List <HistoryEntry >> map = new HashMap <>();
436
435
HashMap <String , Boolean > acceptanceCache = new HashMap <>();
437
- Set <String > renamedFiles = new HashSet <>();
438
436
439
437
/*
440
438
* Go through all history entries for this repository (acquired through
@@ -496,7 +494,6 @@ public void store(History history, Repository repository, String tillRevision) t
496
494
for (Map .Entry <String , List <HistoryEntry >> map_entry : map .entrySet ()) {
497
495
try {
498
496
if (handleRenamedFiles && isRenamedFile (map_entry .getKey (), repository , history )) {
499
- renamedFiles .add (map_entry .getKey ());
500
497
continue ;
501
498
}
502
499
} catch (IOException ex ) {
@@ -516,7 +513,7 @@ public void store(History history, Repository repository, String tillRevision) t
516
513
return ;
517
514
}
518
515
519
- storeRenamed (renamedFiles , repository , tillRevision );
516
+ storeRenamed (history . getRenamedFiles () , repository , tillRevision );
520
517
521
518
finishStore (repository , latestRev );
522
519
}
@@ -532,7 +529,8 @@ public void storeRenamed(Set<String> renamedFiles, Repository repository, String
532
529
return ;
533
530
}
534
531
535
- renamedFiles = renamedFiles .stream ().filter (f -> new File (env .getSourceRootPath () + f ).exists ()).
532
+ renamedFiles = renamedFiles .stream ().map (e -> repository .getDirectoryNameRelative () + File .separator + e ).
533
+ filter (f -> new File (env .getSourceRootPath () + f ).exists ()).
536
534
collect (Collectors .toSet ());
537
535
LOGGER .log (Level .FINE , "Storing history for {0} renamed files in repository ''{1}''" ,
538
536
new Object []{renamedFiles .size (), repository .getDirectoryName ()});
0 commit comments