LocalDiskRepositoryManager: Handle failure to visit file/path
If Files.walkFileTree fails due to a directory or file in the git root being inaccessible, it throws an exception and subsequent directories are not processed. Override the visitFileFailed method on the visitor. Log the error and continue. Bug: Issue 5698 Change-Id: I7f4d76b30f3f8907128dacf357b70eea47fb0962
This commit is contained in:
@@ -405,6 +405,12 @@ public class LocalDiskRepositoryManager implements GitRepositoryManager,
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileVisitResult visitFileFailed(Path file, IOException e) {
|
||||
log.warn(e.getMessage());
|
||||
return FileVisitResult.CONTINUE;
|
||||
}
|
||||
|
||||
private boolean isRepo(Path p) {
|
||||
String name = p.getFileName().toString();
|
||||
return !name.equals(Constants.DOT_GIT)
|
||||
|
||||
Reference in New Issue
Block a user