Split splits a remote into a parent and a leaf if it returns leaf as an empty string then remote is a directory if it returns parent as an empty string then that means the current directory The returned values have the property that parent + leaf == remote (except under Windows where \ will be tr
(remote string)
| 300 | // The returned values have the property that parent + leaf == remote |
| 301 | // (except under Windows where \ will be translated into /) |
| 302 | func Split(remote string) (parent string, leaf string, err error) { |
| 303 | remoteName, remotePath, err := SplitFs(remote) |
| 304 | if err != nil { |
| 305 | return "", "", err |
| 306 | } |
| 307 | // Construct new remote name without last segment |
| 308 | parent, leaf = path.Split(remotePath) |
| 309 | return remoteName + parent, leaf, nil |
| 310 | } |
| 311 | |
| 312 | // Make filePath absolute so it can't read above the root |
| 313 | func makeAbsolute(filePath string) string { |
searching dependent graphs…