code: func (w *PackWriter) waitBuildIndex() error {
  	err := <-w.result
  	if err == packfile.ErrEmptyPackfile {
  		return nil
  	}
  
  	return err
  }
docs: // waitBuildIndex waits until buildIndex function finishes, this can terminate
  // with a packfile.ErrEmptyPackfile, this means that nothing was written so we
  // ignore the error