7y-9
d569dd686f
fix(shell): move files into existing destination directories ( #9887 )
...
* fix(shell): move files into existing destination directories
Problem: fs.mv /src/file /dst/dir treats an existing destination directory as a destination file path, so it renames the source to /dst/dir instead of moving it into /dst/dir/file.
Root cause: commandFsMv builds the destination LookupDirectoryEntryRequest with Directory and Name swapped, so the destination directory lookup misses.
Fix: Populate LookupDirectoryEntryRequest with Directory=destinationDir and Name=destinationName before deciding whether the destination is a directory.
Reproduction: env GOCACHE=/private/tmp/seaweedfs-go-cache go test ./weed/shell -run TestFsMvMovesIntoExistingDestinationDirectory -count=1
Validation: gofmt -w weed/shell/command_fs_mv.go weed/shell/command_fs_mv_test.go; git diff --check; git diff --cached --check; env GOCACHE=/private/tmp/seaweedfs-go-cache go test ./weed/shell -run TestFsMvMovesIntoExistingDestinationDirectory -count=1; env GOCACHE=/private/tmp/seaweedfs-go-cache go test ./weed/shell -count=1
* Update weed/shell/command_fs_mv_test.go
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-06-08 23:42:13 -07:00
..
2026-06-01 15:11:02 -07:00
2026-01-07 13:06:08 -08:00
2026-01-07 13:06:08 -08:00
2026-01-07 13:06:08 -08:00
2026-01-07 13:06:08 -08:00
2026-01-07 13:06:08 -08:00
2026-01-07 13:06:08 -08:00
2026-05-20 23:31:21 -07:00
2026-05-20 23:31:21 -07:00
2025-11-09 19:58:38 -08:00
2026-04-21 20:17:42 -07:00
2026-04-21 20:17:42 -07:00
2026-03-03 15:10:40 -08:00
2026-06-07 14:14:45 -07:00
2026-06-01 19:25:15 -07:00
2026-02-09 01:37:56 -08:00
2026-06-01 19:25:15 -07:00
2026-03-14 20:59:47 -07:00
2026-03-14 16:18:29 -07:00
2026-05-31 18:52:44 -07:00
2026-05-22 20:22:09 -07:00
2025-10-24 20:21:35 -07:00
2025-10-24 20:21:35 -07:00
2026-05-07 17:45:04 -07:00
2026-04-17 21:09:36 -07:00
2026-04-17 21:09:36 -07:00
2025-10-24 20:21:35 -07:00
2026-01-07 13:06:08 -08:00
2025-10-24 20:21:35 -07:00
2026-04-23 19:17:35 -07:00
2025-10-24 20:21:35 -07:00
2026-04-28 12:30:13 -07:00
2026-04-28 12:30:13 -07:00
2026-01-14 21:37:50 -08:00
2026-06-01 09:54:22 -07:00
2025-10-24 20:21:35 -07:00
2026-06-08 23:42:13 -07:00
2026-06-08 23:42:13 -07:00
2025-10-24 20:21:35 -07:00
2025-10-24 20:21:35 -07:00
2025-10-24 20:21:35 -07:00
2026-06-01 09:54:22 -07:00
2026-01-07 13:06:08 -08:00
2025-10-17 22:11:50 -07:00
2026-01-07 13:06:08 -08:00
2025-10-13 18:05:17 -07:00
2026-05-12 12:37:09 -07:00
2026-01-07 13:06:08 -08:00
2026-01-07 13:06:08 -08:00
2025-09-09 01:01:03 -07:00
2026-06-08 13:55:53 -07:00
2026-05-07 17:45:04 -07:00
2026-03-11 12:55:45 -07:00
2026-06-08 13:55:53 -07:00
2026-03-12 15:21:07 -07:00
2026-03-13 09:36:54 -07:00
2026-02-05 12:57:27 -08:00
2026-02-05 12:57:27 -08:00
2026-01-07 13:06:08 -08:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-03-25 23:09:53 -07:00
2026-05-18 13:42:32 -07:00
2026-01-27 10:50:16 -08:00
2025-12-13 13:41:25 -08:00
2026-06-06 11:20:15 -07:00
2025-12-12 18:06:13 -08:00
2026-01-27 10:50:16 -08:00
2025-12-12 18:06:13 -08:00
2026-06-01 13:11:18 -07:00
2025-07-16 23:39:27 -07:00
2026-02-26 11:56:10 -08:00
2022-09-16 02:43:49 -07:00
2026-05-07 17:45:04 -07:00
2025-07-16 23:39:27 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-06-01 15:11:02 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-12 18:29:18 -07:00
2026-05-13 00:19:05 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-18 13:42:32 -07:00
2026-05-13 10:48:58 -07:00
2026-04-28 12:30:13 -07:00
2026-01-30 22:57:05 -08:00
2026-04-28 12:30:13 -07:00
2026-01-30 22:57:05 -08:00
2026-03-03 15:10:40 -08:00
2026-06-07 14:14:45 -07:00
2026-06-07 14:14:45 -07:00
2025-12-02 10:14:24 -08:00
2026-05-21 02:16:28 -07:00
2026-01-16 12:31:48 -08:00
2026-02-24 20:07:26 -08:00
2026-05-06 15:19:43 -07:00
2026-05-06 15:19:43 -07:00
2024-09-26 08:34:13 -07:00
2026-05-06 15:19:43 -07:00
2026-06-01 09:54:22 -07:00
2026-01-07 13:06:08 -08:00
2026-05-31 11:52:39 -07:00
2026-05-31 11:52:39 -07:00
2024-09-29 10:38:22 -07:00
2026-05-28 19:29:25 -07:00
2026-05-28 19:29:25 -07:00
2026-01-07 13:06:08 -08:00
2026-05-06 15:19:43 -07:00
2026-03-26 10:20:57 -07:00
2023-03-13 10:00:27 -07:00
2026-05-20 10:27:00 -07:00
2025-11-09 19:58:38 -08:00
2026-02-11 11:02:37 -08:00
2026-03-20 23:52:12 -07:00
2026-03-20 23:52:12 -07:00
2025-08-23 11:04:24 -07:00
2026-05-21 02:16:28 -07:00
2026-05-06 15:19:43 -07:00
2026-01-07 13:06:08 -08:00
2024-09-29 10:38:22 -07:00
2024-09-29 10:38:22 -07:00
2026-04-20 15:32:31 -07:00
2026-04-07 14:10:15 -07:00
2026-05-21 02:16:28 -07:00
2025-12-15 11:18:45 -08:00
2026-01-16 12:31:48 -08:00
2026-04-03 16:04:27 -07:00
2026-01-06 00:09:52 -08:00
2026-06-01 15:11:02 -07:00
2026-04-08 13:07:15 -07:00
2025-12-15 11:18:45 -08:00
2025-12-15 11:18:45 -08:00
2025-12-15 11:18:45 -08:00