Skip to content

Commit ca246c5

Browse files
committed
incus/file: Properly handle relative source paths
Not too sure why we were using Split rather than Dir given we were discarding the Base part of the path. But it looks like Split gets a bit confused by relative parent paths (..) whereas Dir doesn't. Closes #1808 Signed-off-by: Stéphane Graber <[email protected]>
1 parent a798f4f commit ca246c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/incus/file.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ func (c *cmdFile) recursivePullFile(sftpConn *sftp.Client, p string, targetDir s
11801180

11811181
func (c *cmdFile) recursivePushFile(sftpConn *sftp.Client, source string, target string) error {
11821182
source = filepath.Clean(source)
1183-
sourceDir, _ := filepath.Split(source)
1183+
sourceDir := filepath.Dir(source)
11841184
sourceLen := len(sourceDir)
11851185

11861186
sendFile := func(p string, fInfo os.FileInfo, err error) error {

0 commit comments

Comments
 (0)