pico

created pr with pico/98.1 on 2025-12-19T01:28:25Z · by c8ef7d19
added pico/98.2 on 2025-12-19T01:39:08Z · by c8ef7d19
1: f8ad8c5 = 1: f8ad8c5 fix(rsync): delete largest path first
-: ------- > 2: 0d69224 chore: add tests
cmds
checkout latest patchset:
ssh pr.pico.sh pull pico:98 | git am -3
checkout specific patchset revision:
ssh pr.pico.sh pull pico:98 [rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pico:98
add comment to patch request:
ssh pr.pico.sh comment pico:98 "lgtm!"

Patchset pico/98.2 on 2025-12-19T01:39:08Z · commit f8ad8c5

+8 -0 pkg/send/protocols/rsync/rsync.go #
......@@ -153,6 +153,14 @@ func (h *handler) Remove(willReceive []*rsyncutils.ReceiverFile) error {
153153 }
154154 }
155155
156+ // Sort by path depth descending so children are deleted before parents.
157+ // This ensures directories are empty before we try to remove them.
158+ slices.SortFunc(toDelete, func(a, b string) int {
159+ depthA := strings.Count(a, "/")
160+ depthB := strings.Count(b, "/")
161+ return depthB - depthA
162+ })
163+
156164 var errs []error
157165
158166 for _, file := range toDelete {
Back to top