code: func (d *DotGit) Alternates() ([]*DotGit, error) {
  	altpath := d.fs.Join("objects", "info", "alternates")
  	f, err := d.fs.Open(altpath)
  	if err != nil {
  		return nil, err
  	}
  	defer f.Close()
  
  	var alternates []*DotGit
  
  	// Read alternate paths line-by-line and create DotGit objects.
  	scanner := bufio.NewScanner(f)
  	for scanner.Scan() {
  		path := scanner.Text()
  		if !filepath.IsAbs(path) {
  			// For relative paths, we can perform an internal conversion to
  			// slash so that they work cross-platform.
  			slashPath := filepath.ToSlash(path)
  			// If the path is not absolute, it must be relative to object
  			// database (.git/objects/info).
  			// https://www.kernel.org/pub/software/scm/git/docs/gitrepository-layout.html
  			// Hence, derive a path relative to DotGit's root.
  			// "../../../reponame/.git/" -> "../../reponame/.git"
  			// Remove the first ../
  			relpath := filepath.Join(strings.Split(slashPath, "/")[1:]...)
  			normalPath := filepath.FromSlash(relpath)
  			path = filepath.Join(d.fs.Root(), normalPath)
  		}
  		fs := osfs.New(filepath.Dir(path))
  		alternates = append(alternates, New(fs))
  	}
  
  	if err = scanner.Err(); err != nil {
  		return nil, err
  	}
  
  	return alternates, nil
  }
docs: // Alternates returns DotGit(s) based off paths in objects/info/alternates if
  // available. This can be used to checks if it's a shared repository.