code: func incomingOrCached(r io.Reader, ptr *lfs.Pointer) (io.Reader, error) {
  	buf := make([]byte, 1024)
  	n, err := r.Read(buf)
  	buf = buf[:n]
  
  	if n == 0 {
  		if ptr == nil {
  			// If we read no data from the given io.Reader "r" _and_
  			// there was no data to fall back on, return an empty
  			// io.Reader yielding no data.
  			return bytes.NewReader(buf), nil
  		}
  		// If we read no data from the given io.Reader "r", _and_ there
  		// is a pointer that we can fall back on, return an io.Reader
  		// that yields the encoded version of the given pointer.
  		return strings.NewReader(ptr.Encoded()), nil
  	}
  
  	if err == io.EOF {
  		return bytes.NewReader(buf), nil
  	}
  	return io.MultiReader(bytes.NewReader(buf), r), err
  }
docs: // incomingOrCached returns an io.Reader that is either the contents of the
  // given io.Reader "r", or the encoded contents of "ptr". It returns an error if
  // there was an error reading from "r".
  //
  // This is done because when a `command=smudge` with `can-delay=0` is issued,
  // the entry's contents are not sent, and must be re-encoded from the stored
  // pointer corresponding to the request's filepath.