code: func NewDiffIndexScanner(ref string, cached bool) (*DiffIndexScanner, error) {
  	scanner, err := git.DiffIndex(ref, cached)
  	if err != nil {
  		return nil, err
  	}
  	return &DiffIndexScanner{
  		from: scanner,
  	}, nil
  }
docs: // NewDiffIndexScanner initializes a new `DiffIndexScanner` scanning at the
  // given ref, "ref".
  //
  // If "cache" is given, the DiffIndexScanner will scan for differences between
  // the given ref and the index. If "cache" is _not_ given, DiffIndexScanner will
  // scan for differences between the given ref and the currently checked out
  // tree.
  //
  // If any error was encountered in starting the command or closing its `stdin`,
  // that error will be returned immediately. Otherwise, a `*DiffIndexScanner`
  // will be returned with a `nil` error.