hasSymlinkInPath returns true if there is any symlink in path hierarchy using the given base and relative path.
(base, relPath string)
| 119 | // hasSymlinkInPath returns true if there is any symlink in path hierarchy using |
| 120 | // the given base and relative path. |
| 121 | func 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 | |
| 132 | type UpdateRepoFileOptions struct { |
| 133 | OldBranch string |
no test coverage detected