mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
Implements rollout steps 1 and 2 of proposals/274-skillfollow.md. Nothing follows a link or parses .skillfollow yet. Step 1: doctor reports first-level symlinks and junctions in the skills source as info, in text and JSON, without following them. Step 2a: internal/sourcewalk owns traversal of the skills source. Thirteen raw walks move onto it with identical behavior, and a go/parser ratchet fails the tests on any new unclassified walk. Step 2b: internal/sourcefs wraps an os.Root opened at the skills source and refuses any write whose path has a link component. The six write sites the proposal found in review move onto it, including the cross-device copy fallback, and a second ratchet covers raw os write calls. The only behavior change is that an explicit path crossing a link inside the source is refused instead of written through. Refs #274 Release-As: 0.24.3
15 lines
338 B
Go
15 lines
338 B
Go
package sourcefs
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
// IsCrossDevice reports whether err is a rename that failed because the two
|
|
// paths live on different volumes. It is the only MoveIn failure that CopyIn
|
|
// may recover from.
|
|
func IsCrossDevice(err error) bool {
|
|
return errors.Is(err, windows.ERROR_NOT_SAME_DEVICE)
|
|
}
|