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

Method Symlink

worktree_fs.go:108–116  ·  view source on GitHub ↗
(target, link string)

Source from the content-addressed store, hash-verified

106}
107
108func (sfs *worktreeFilesystem) Symlink(target, link string) error {
109 if err := sfs.validPath(link); err != nil {
110 return fmt.Errorf("symlink: %w", err)
111 }
112 if err := sfs.validSymlinkName(link); err != nil {
113 return fmt.Errorf("symlink: %w", err)
114 }
115 return sfs.Filesystem.Symlink(target, link)
116}
117
118func (sfs *worktreeFilesystem) Readlink(link string) (string, error) {
119 if err := sfs.validReadPath(link); err != nil {

Callers 10

checkoutFileSymlinkMethod · 0.45
TestCheckoutSymlinkMethod · 0.45
TestAddSymlinkMethod · 0.45
TestDiffMethod · 0.45
TestDiffChangeLinkMethod · 0.45
TestDiffSymlinkDirOnAMethod · 0.45
TestDiffSymlinkDirOnBMethod · 0.45
SetUpSuiteMethod · 0.45

Calls 2

validPathMethod · 0.95
validSymlinkNameMethod · 0.95

Tested by 9

TestCheckoutSymlinkMethod · 0.36
TestAddSymlinkMethod · 0.36
TestDiffMethod · 0.36
TestDiffChangeLinkMethod · 0.36
TestDiffSymlinkDirOnAMethod · 0.36
TestDiffSymlinkDirOnBMethod · 0.36
SetUpSuiteMethod · 0.36