code: def sanitize_git_path(self, uri, ref=None):
          
          if uri.endswith('.git'):
              dir_name = uri[:-4]  # drop .git
          else:
              dir_name = uri
          dir_name = self.sanitize_uri_path(dir_name)
          if ref is not None:
              dir_name += "-%s" % ref
          return dir_name
docs: Take a git URI and ref and converts it to a directory safe path.
  
          Args:
              uri (string): git URI
                            (e.g. git@github.com:foo/bar.git)
              ref (string): optional git ref to be appended to the path
  
          Returns:
              str: Directory name for the supplied uri