File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
io/src/test/scala/sbt/internal/io Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -513,16 +513,11 @@ object EventMonitorSpec {
513513 override def toString : String = string
514514 }
515515 }
516- @ tailrec
517516 final def realPath (path : Path , fileName : Option [Path ] = None ): Path = {
518- val res : Path =
519- try path.toRealPath()
520- catch { case _ : IOException => null }
521- if (res != null ) fileName.fold(res)(res.resolve)
522- else {
523- val newFileName = path.getFileName
524- realPath(path.getParent, fileName.map(newFileName.resolve) orElse Some (newFileName))
525- }
517+ val res =
518+ if (Files .exists(path)) path.toRealPath()
519+ else path.toAbsolutePath()
520+ fileName.fold(res)(res.resolve)
526521 }
527522 def pathFilter (path : Path ): FileEvent [? ] => Boolean = {
528523 val real = realPath(path)
You can’t perform that action at this time.
0 commit comments