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

Function CloneFileByPath

tools/util_linux.go:55–68  ·  view source on GitHub ↗
(dst, src string)

Source from the content-addressed store, hash-verified

53}
54
55func CloneFileByPath(dst, src string) (bool, error) {
56 srcFile, err := os.Open(src)
57 if err != nil {
58 return false, err
59 }
60 defer srcFile.Close()
61 dstFile, err := os.Create(dst) //truncating, it if it already exists.
62 if err != nil {
63 return false, err
64 }
65 defer dstFile.Close()
66
67 return CloneFile(dstFile, srcFile)
68}

Callers 3

dedupFunction · 0.92
TestMethodExistsFunction · 0.70
TestCloneFileByPathFunction · 0.70

Calls 2

CloneFileFunction · 0.70
CloseMethod · 0.65

Tested by 2

TestMethodExistsFunction · 0.56
TestCloneFileByPathFunction · 0.56