// Returns a nil node if p doesn't have type tlfPath. func (p kbfsPath) getNode(ctx context.Context, config libkbfs.Config) (n libkbfs.Node, ei libkbfs.EntryInfo, err error) { if p.pathType != tlfPath { ei := libkbfs.EntryInfo{ Type: libkbfs.Dir, } return nil, ei, nil } var h *libkbfs.TlfHandle name := p.tlfName outer: for { h, err = libkbfs.ParseTlfHandle( ctx, config.KBPKI(), name, p.public, config.SharingBeforeSignupEnabled()) switch err := err.(type) { case nil: // No error. break outer case libkbfs.TlfNameNotCanonical: // Non-canonical name, so try again. name = err.NameToTry default: // Some other error. return nil, libkbfs.EntryInfo{}, err } } n, ei, err = config.KBFSOps().GetOrCreateRootNode( ctx, h, libkbfs.MasterBranch) for _, component := range p.tlfComponents { cn, cei, err := config.KBFSOps().Lookup(ctx, n, component) if err != nil { return nil, libkbfs.EntryInfo{}, err } n = cn ei = cei } return n, ei, nil }