code: func (r *Rewriter) scannerOpts() *git.ScanRefsOptions {
  	opts := &git.ScanRefsOptions{
  		Mode:        git.ScanRefsMode,
  		Order:       git.TopoRevListOrder,
  		Reverse:     true,
  		CommitsOnly: true,
  
  		SkippedRefs: make([]string, 0),
  		Mutex:       new(sync.Mutex),
  		Names:       make(map[string]string),
  	}
  
  	if root, ok := r.db.Root(); ok {
  		opts.WorkingDir = root
  	}
  	return opts
  }
docs: // scannerOpts returns a *git.ScanRefsOptions instance to be given to the
  // *git.RevListScanner.
  //
  // If the database this *Rewriter is operating in a given root (not in memory)
  // it re-assigns the working directory to be there.