Skip to content

Commit fe571d1

Browse files
Vladimir Kotalahornace
authored andcommitted
get rid of isRenamedFile()
fixes #3587
1 parent 5794e3b commit fe571d1

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/FileHistoryCache.java

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,6 @@ private void doFileHistory(String filename, History history, Repository reposito
152152
storeFile(history, file, repository, !renamed);
153153
}
154154

155-
private boolean isRenamedFile(String filename, Repository repository, History history)
156-
throws IOException {
157-
158-
String repodir;
159-
try {
160-
repodir = env.getPathRelativeToSourceRoot(new File(repository.getDirectoryName()));
161-
} catch (ForbiddenSymlinkException e) {
162-
LOGGER.log(Level.FINER, e.getMessage());
163-
return false;
164-
}
165-
String shortestfile = filename.substring(repodir.length() + 1);
166-
167-
return (history.isRenamed(shortestfile));
168-
}
169-
170155
static class FilePersistenceDelegate extends PersistenceDelegate {
171156
@Override
172157
protected Expression instantiate(Object oldInstance, Encoder out) {
@@ -492,12 +477,8 @@ public void store(History history, Repository repository, String tillRevision) t
492477
final File root = env.getSourceRootFile();
493478
int fileHistoryCount = 0;
494479
for (Map.Entry<String, List<HistoryEntry>> map_entry : map.entrySet()) {
495-
try {
496-
if (handleRenamedFiles && isRenamedFile(map_entry.getKey(), repository, history)) {
497-
continue;
498-
}
499-
} catch (IOException ex) {
500-
LOGGER.log(Level.WARNING, "isRenamedFile() got exception", ex);
480+
if (handleRenamedFiles && history.isRenamed(map_entry.getKey())) {
481+
continue;
501482
}
502483

503484
doFileHistory(map_entry.getKey(), new History(map_entry.getValue()),

0 commit comments

Comments
 (0)