def _url_prefix(url):
  """Determine url up to the terminal path component."""
  # We're assuming no query parameter/fragment since these are git URLs.
  # otherwise we need to parse the url and extract the path
  return url[:url.rfind('/')]