MCPcopy Create free account
hub / github.com/gogs/gogs / hasSymlinkInPath

Function hasSymlinkInPath

internal/database/repo_editor.go:121–130  ·  view source on GitHub ↗

hasSymlinkInPath returns true if there is any symlink in path hierarchy using the given base and relative path.

(base, relPath string)

Source from the content-addressed store, hash-verified

119// hasSymlinkInPath returns true if there is any symlink in path hierarchy using
120// the given base and relative path.
121func hasSymlinkInPath(base, relPath string) bool {
122 parts := strings.Split(filepath.ToSlash(relPath), "/")
123 for i := range parts {
124 filePath := path.Join(append([]string{base}, parts[:i+1]...)...)
125 if osutil.IsSymlink(filePath) {
126 return true
127 }
128 }
129 return false
130}
131
132type UpdateRepoFileOptions struct {
133 OldBranch string

Callers 4

UpdateRepoFileMethod · 0.85
GetDiffPreviewMethod · 0.85
DeleteRepoFileMethod · 0.85
UploadRepoFilesMethod · 0.85

Calls 3

IsSymlinkFunction · 0.92
appendFunction · 0.85
SplitMethod · 0.80

Tested by

no test coverage detected