MCPcopy Create free account
hub / github.com/cli/cli / isPathRedirect

Function isPathRedirect

internal/safepaths/link_windows.go:15–20  ·  view source on GitHub ↗
(owner *Root, root *os.Root, name string, info os.FileInfo)

Source from the content-addressed store, hash-verified

13var errUnsupportedNonLinkReparse = errors.New("non-link reparse points cannot be safely opened beneath a rooted directory on Windows")
14
15func isPathRedirect(owner *Root, root *os.Root, name string, info os.FileInfo) (bool, error) {
16 return classifyWindowsPathRedirect(info, func() error {
17 _, err := owner.readlink(root, name)
18 return err
19 })
20}
21
22func classifyWindowsPathRedirect(info os.FileInfo, readlink func() error) (bool, error) {
23 if info.Mode()&os.ModeSymlink != 0 {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected