code: func (w *Worktree) RemoveGlob(pattern string) error {
  	idx, err := w.r.Storer.Index()
  	if err != nil {
  		return err
  	}
  
  	entries, err := idx.Glob(pattern)
  	if err != nil {
  		return err
  	}
  
  	for _, e := range entries {
  		file := filepath.FromSlash(e.Name)
  		if _, err := w.Filesystem.Lstat(file); err != nil && !os.IsNotExist(err) {
  			return err
  		}
  
  		if _, err := w.doRemoveFile(idx, file); err != nil {
  			return err
  		}
  
  		dir, _ := filepath.Split(file)
  		if err := w.removeEmptyDirectory(dir); err != nil {
  			return err
  		}
  	}
  
  	return w.r.Storer.SetIndex(idx)
  }
docs: // RemoveGlob removes all paths, matching pattern, from the index. If pattern
  // matches a directory path, all directory contents are removed from the index
  // recursively.