MCPcopy
hub / github.com/go-git/go-git / OpenFile

Method OpenFile

worktree_fs.go:66–71  ·  view source on GitHub ↗
(filename string, flag int, perm os.FileMode)

Source from the content-addressed store, hash-verified

64}
65
66func (sfs *worktreeFilesystem) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error) {
67 if err := sfs.validPath(filename); err != nil {
68 return nil, fmt.Errorf("openfile: %w", err)
69 }
70 return sfs.Filesystem.OpenFile(filename, flag, perm)
71}
72
73func (sfs *worktreeFilesystem) Stat(filename string) (os.FileInfo, error) {
74 if err := sfs.validReadPath(filename); err != nil {

Callers 6

checkoutFileMethod · 0.45
checkoutFileSymlinkMethod · 0.45
WriteFileFunction · 0.45
prepareRepoFunction · 0.45

Calls 1

validPathMethod · 0.95

Tested by 4

WriteFileFunction · 0.36
prepareRepoFunction · 0.36