code: func (mi *MemoryIndex) GetIndexByHash(h plumbing.Hash) (int, error) {
  	i, ok := mi.indexMap[h]
  	if ok {
  		return i, nil
  	}
  
  	return 0, plumbing.ErrObjectNotFound
  }
docs: // GetIndexByHash gets the index in the commit graph from commit hash, if available