code: func (ut *UploadTracker) tarAndUploadFiles(smallFiles []*Item) error {
  	bundles := shardItems(smallFiles, archiveMaxSize)
  	log.Printf("\t%d TAR archives to be isolated", len(bundles))
  
  	for _, bundle := range bundles {
  		bundle := bundle
  		digest, tarSize, err := bundle.Digest(ut.checker.Hash())
  		if err != nil {
  			return err
  		}
  
  		log.Printf("Created tar archive %q (%s)", digest, humanize.Bytes(uint64(tarSize)))
  		log.Printf("\tcontains %d files (total %s)", len(bundle.items), humanize.Bytes(uint64(bundle.itemSize)))
  		// Mint an item for this tar.
  		item := &Item{
  			Path:    fmt.Sprintf(".%s.tar", digest),
  			RelPath: fmt.Sprintf(".%s.tar", digest),
  			Size:    tarSize,
  			Digest:  digest,
  		}
  		ut.isol.Files[item.RelPath] = isolated.TarFile(item.Digest, item.Size)
  
  		ut.checker.AddItem(item, false, func(item *Item, ps *isolatedclient.PushState) {
  			if ps == nil {
  				return
  			}
  
  			// We are about to upload item. If we fail, the entire isolate operation will fail.
  			// If we succeed, then item will be on the server by the time that the isolate operation
  			// completes. So it is safe for subsequent checks to assume that the item exists.
  			ut.checker.PresumeExists(item)
  
  			log.Printf("QUEUED %q for upload", item.RelPath)
  			ut.uploader.Upload(item.RelPath, bundle.Contents, ps, func() {
  				log.Printf("UPLOADED %q", item.RelPath)
  			})
  		})
  	}
  	return nil
  }
docs: // tarAndUploadFiles creates bundles of files, uploads them, and adds each bundle to files.