docs: static String[] split(URI remoteUri, String suffix, @Nullable String defaultBranch) {
          final String host = remoteUri.getHost();
          if (host == null && !remoteUri.getScheme().endsWith("+file")) {
              throw new IllegalArgumentException("no host in remoteUri: " + remoteUri);
          }
  
          final String path = remoteUri.getRawPath();
          if (path == null) {
              throw new IllegalArgumentException("no path in remoteUri: " + remoteUri);
          }
  
          final Matcher matcher = Pattern.compile("^(.*?\\." + suffix + ")(?:$|/)").matcher(path);
          if (!matcher.find()) {
              throw new IllegalArgumentException("no '." + suffix + "' in remoteUri path: " + remoteUri);
          }
  
          final String newRemoteUri;
          final int port = remoteUri.getPort();
          if (host != null) {
              if (port > 0) {
                  newRemoteUri = remoteUri.getScheme() + "://" + host + ':' + port +
                                 matcher.group(1);
              } else {
                  newRemoteUri = remoteUri.getScheme() + "://" + host + matcher.group(1);
              }
          } else {
              newRemoteUri = remoteUri.getScheme() + "://" + matcher.group(1);
          }
  
          final String remotePath;
          try {
              String decoded = URLDecoder.decode(path.substring(matcher.group(1).length()), "UTF-8");
              decoded = normalizePath(decoded);
  
              remotePath = decoded;
          } catch (UnsupportedEncodingException e) {
              throw new Error(e);
          }
  
          final String fragment = remoteUri.getFragment();
          final String remoteBranch = fragment != null ? fragment : defaultBranch;
  
          return new String[] { newRemoteUri, remotePath, remoteBranch };
      }