code: func (sis *SegmentInfos) prepareCommit(dir store.Directory) error {
  	assert2(sis.pendingSegnOutput == nil, "prepareCommit was already called")
  	return sis.write(dir)
  }
docs: /*
  Call this to start a commit. This writes the new segments file, but
  writes an invalid checksum at the end, so that it is not visible to
  readers. Once this is called you must call finishCommit() to complete
  the commit or rollbackCommit() to abort it.
  
  Note: changed() should be called prior to this method if changes have
  been made to this SegmentInfos instance.
  */