MCPcopy
hub / github.com/git-lfs/git-lfs / checkCloneFileSupported

Function checkCloneFileSupported

tools/util_darwin.go:32–49  ·  view source on GitHub ↗

checkCloneFileSupported return iff Mac OS version is greater or equal to 10.12.x Sierra. clonefile is supported since Mac OS X 10.12 https://www.manpagez.com/man/2/clonefile/ kern.osrelease mapping 17.x.x. macOS 10.13.x High Sierra. 16.x.x macOS 10.12.x Sierra. 15.x.x OS X 10.11.x El Capitan.

()

Source from the content-addressed store, hash-verified

30// 16.x.x macOS 10.12.x Sierra.
31// 15.x.x OS X 10.11.x El Capitan.
32func checkCloneFileSupported() bool {
33 bytes, err := unix.Sysctl("kern.osrelease")
34 if err != nil {
35 return false
36 }
37
38 versionString := strings.Split(string(bytes), ".") // major.minor.patch
39 if len(versionString) < 2 {
40 return false
41 }
42
43 major, err := strconv.Atoi(versionString[0])
44 if err != nil {
45 return false
46 }
47
48 return major >= 16
49}
50
51// CheckCloneFileSupported runs explicit test of clone file on supplied directory.
52// This function creates some (src and dst) file in the directory and remove after test finished.

Callers 2

initFunction · 0.85

Calls

no outgoing calls

Tested by 1