code: func IsLocalNonBareGitRepository(fs fs.FileSystem, dir string) (bool, error) {
  	_, err := fs.Stat(filepath.Join(dir, ".git"))
  	if os.IsNotExist(err) {
  		return false, nil
  	}
  	if err != nil {
  		return false, err
  	}
  	return true, nil
  }
docs: // IsLocalNonBareGitRepository returns true if dir hosts a non-bare git
  // repository, i.e. it contains a ".git" subdirectory or file (submodule case).