final Pair<PathType, ObjectId> sourceResult = checkPath( source.getFileSystem().gitRepo(), source.getRefTree(), source.getPath() );
final Pair<PathType, ObjectId> targetResult = checkPath( target.getFileSystem().gitRepo(), target.getRefTree(), target.getPath() );
if ( !isRoot( target ) && targetResult.getK1() != NOT_FOUND ) {
if ( !contains( options, StandardCopyOption.REPLACE_EXISTING ) ) {
throw new FileAlreadyExistsException( target.toString() );
}
}
if ( sourceResult.getK1() == NOT_FOUND ) {
throw new NoSuchFileException( target.toString() );